pubsub: With exactly once delivery and message ordering enabled, message order is not mantained #9440
Labels
api: pubsub
Issues related to the Pub/Sub API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
PubSub
Expected behavior
Messages received are in the order the server delivers them
Actual behavior
Messages are reordered randomly when iterating over pendingMessages map
Additional context
On iterator.go, messageIterator.receive method, a pendingMessages map is created from the message list to remove any messages where modAck fails. After processing, a new message list is created iterating over the resulting pendingMessages object:
The order in which items are appended is not necessarily the same of the original list of messages (https://go.dev/blog/maps). Message ordering feature is thus broken
The text was updated successfully, but these errors were encountered: