Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove cursor while remove non-durable subscription #5719
Remove cursor from cursors of managed ledger while remove non-durable subscription. The data deletion is depends the mark delete position of all cursors, if left a unused cursor in the cursors of managed ledger, data can't be delete as expected.
Remove cursor while remove non-durable subscription
Verifying this change
Add new unit test to cover this change
Does this pull request potentially affect one of the following parts:
1 similar comment
We need an approach related to seek position, current approach will close all consumers while seek position happens, but this PR will remove the non-durable cursor while all consumers of the non-durable subscription are disconnected. So the reconnected consumer will create a new non-durable cursor using last message id, the unit test can't passed.
It's better to have an approach to handle the position seek, there are two point we need to careful handling:
Here, the outstanding messages means messages already dispatched to consumers but the cursor is reset.
For the first point, i think we can use the
For the second point, if the consumer cache to many outstanding messages, it's waste of resources if process all of these messages, so it's better to send a cursor reseted notify to consumers before dispatch messages after the cursor reset to consumers, consumers can reset their stat, clear the outstanding messages. currently close consumers also can reset consumer state, clear outstanding messages.
And in #5278, we also have discussed about the reset consumer state when cursor reset happens.
For this PR, i think we can don't close the readers first, and then create a new PR to improve cursor reset since it might need to change the wire protocol.