-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIP 194 : Pulsar client: seek command add epoch #16757
Comments
2 tasks
Looks like this PIP can fix the problem #13788 in the "Reader with seeking" case. |
This PIP should be able to fix #16171. |
I believe so. |
Cool. This would fix the duplicated message issues when using |
The issue had no activity for 30 days, mark with Stale label. |
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Reader
belongs to exclusive subscription type, and it usesnonDurable
cursor. After receiving messages,Reader
will ack cumulatively immediately.The
flowPermits
are triggered in multiple scenarios from the client side and it is isolated fromseek
ofConsumer
. Therefore, it is possibile thatflowPermits
will execute afterseek
from the client side, like the following flow chart.When
handleSeek
processing is delay from the server side, theMarkDelete position
is modified in a wrong way.The expected result is that
Reader
can re-consume messages frommark delete:(1,1)
afterseek
. But it doesn't work.Pulsar read message and seek position is not a synchronous operation, the seek request can't prevent an in-process entry reading operation. The client-side also has an opportunity to receive messages after the seek position.
Pulsar client make read messages operation and seek position operation synchronized so add an epoch into server and client consumer. After client reader consumer invoke
seek
, the epoch increase 1 and sendseek
command carry the epoch and then server consumer will update the epoch. When dispatcher messages to client will carry the epoch which the cursor read at the time. Client consumer will filter the send messages command which is smaller than current epoch.In this way, after the client consumer send
seek
command successfully, because it has passed the epoch filtering, the consumer will not receive a message with a messageID greater than the user previously seek position.Current implementation details
CommandSeek Protocal
CommandMessage
CommandMessage
already add epoch by PIP-84 , when client receiveCommandMessage
will compare the command epoch and local epoch to handle this command.Goal
Add epoch into seek command.
API Changes
Protocal change: CommandSeek
CommandSeek
command add epoch field, when client send seek command to server successfully, the server will change the server consumer epoch to the command epoch. The epoch only can bigger than the old epoch in server. Now the client can filter out the message which contains less consumer epoch.Implementation
Reject Alternatives
None yet.
Note
The text was updated successfully, but these errors were encountered: