Skip to content
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

[Transaction] Fix transaction log recover fail problem. #10146

Conversation

congbobo184
Copy link
Contributor

Motivation

Now transaction log recover by compare lastConfirmedEntry.compareTo(currentLoadPosition) > 0, when the lastConfirmedEntry has acked by cursor, we can't change the currentLoadPosition to lastConfirmedEntry or lastConfirmedEntry + 1, so we should judge the cursor.hasMoreEntries() and entryQueue.size()

implement

judge the cursor.hasMoreEntries() and entryQueue.size() to recover

Verifying this change

Add the tests for it

Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes

Dependencies (does it add or upgrade a dependency): (no)
The public API: (no)
The schema: (no)
The default values of configurations: (no)
The wire protocol: (no)
The rest endpoints: (no)
The admin cli options: (no)
Anything that affects deployment: (no)

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@codelipenghui codelipenghui merged commit 218f498 into apache:master Apr 8, 2021
wangjialing218 pushed a commit to wangjialing218/pulsar that referenced this pull request Apr 9, 2021
## Motivation
Now transaction log recover by compare ```lastConfirmedEntry.compareTo(currentLoadPosition) > 0```, when the ```lastConfirmedEntry``` has acked by cursor, we can't change the currentLoadPosition to ```lastConfirmedEntry``` or  ```lastConfirmedEntry ``` + 1, so we should judge the ```cursor.hasMoreEntries()``` and ```entryQueue.size()```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants