-
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
Handle concurrent open cursor requests #50
Conversation
CLA is valid! |
1 similar comment
CLA is valid! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// Update the ack position (ignoring entries that were written while the cursor was being created) | ||
cursor.initializeCursorPosition(getLastPositionAndCounter()); | ||
|
||
synchronized (this) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, as we are sure that only one thread calls cursor.initialize(..)
then should we need synchronized
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But another thread will be accessing uninitializedCursors
, so we will need it to be synchronized
Change first release version to 1.0.0
Fixes apache#49 Motivation By default, timeout exit after 10 minutes go test --help -timeout d If a test binary runs longer than duration d, panic. If d is 0, the timeout is disabled. The default is 10 minutes (10m).
…opicx (apache#50) In PR apache#47, there is a change to return kafka client with pulsar format topic, This is a change mainly to revert the return of topic name from `persistent://tent/ns/topicx` back to `topicx`. Also added a unit-test for this. Some minor changes, besides this main change: - fix log level when parse listeners port. - change default log4j2 log level from debug to info. - fix assert from ledgeId > 0 to ledgerId >= 0. - add a test for message order. ======== * fix log level for listeners port get * change default log level in log4j2 * fix assert from ledgeId > 0 to ledgerId >= 0 * add a test to check message order * revert the return of topic name from persistent://tent/ns/topicx to topicx * add test for metadata request handling * fix checkstyle * mv utils from request handler to file TopicNameUtils
Motivation
If the Managed Ledger gets concurrent open cursor requests for the same cursor, 1 request fails with Cursor already exists exception.
Modifications
Any cursor that is uninitialized will be reused for the next open cursor request using a Completable Future for the cursor, so that it doesn't try to create a new cursor.
Result
Managed Ledger will be able to handle concurrent open cursor requests properly.