[fix] Generate sequenceID at send time to ensure sequential ordering#1411
[fix] Generate sequenceID at send time to ensure sequential ordering#1411intkuroky wants to merge 3 commits intoapache:masterfrom
Conversation
RobertIndie
left a comment
There was a problem hiding this comment.
Are you able to reproduce the ordering issue?
Flushing batch messages and publishing a single message should happen in the same event loop:
pulsar-client-go/pulsar/producer_partition.go
Lines 563 to 591 in 7a9a33c
How could the out-of-order issue happen?
@RobertIndie |
Motivation
This PR fixes an issue where sequenceID was generated at message creation time instead of send time, causing out-of-order sequence IDs when batching is enabled.
The sequenceID lifecycle (generation -> local storage -> network transmission) must be serialized to ensure consistency.
Modifications