-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Remove cursor while remove non-durable subscription #5719
Remove cursor while remove non-durable subscription #5719
Conversation
run java8 tests |
run java8 tests |
1 similar comment
run java8 tests |
run java8 tests |
run cpp tests |
The failed tests seems related with this change. and @codelipenghui is working on it. |
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. |
@codelipenghui shall we move this to 2.5.1 or 2.6.0 release? |
run java8 tests |
2 similar comments
run java8 tests |
run java8 tests |
Motivation
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.
Modifications
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:
If
yes
was chosen, please highlight the changesDocumentation