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

Validate cursor-readPosition before reading while checkingBacklogCursor #162

Merged
merged 1 commit into from
Jan 9, 2017

Conversation

rdhabalia
Copy link
Contributor

Motivation

Cursor's readPosition might not be a valid (when cursor read last entry of the ledger) when checkBackloggedCursors task tries to read from BK and it raises below exception due to invalid entry:

Caused by: org.apache.bookkeeper.client.BKException$BKReadException: null
at org.apache.bookkeeper.client.LedgerHandle.asyncReadEntries(LedgerHandle.java:459)

Modifications

Get next valid entry before reading from BK if cursor's current readPosition is invalid.

Result

It prevents to failure of checkBacklogCursor if cursor's readPosition is invalid.

@yahoocla
Copy link

yahoocla commented Jan 6, 2017

CLA is valid!

2 similar comments
@yahoocla
Copy link

yahoocla commented Jan 6, 2017

CLA is valid!

@yahoocla
Copy link

yahoocla commented Jan 6, 2017

CLA is valid!

@rdhabalia rdhabalia added the type/bug The PR fixed a bug or issue reported a bug label Jan 6, 2017
@rdhabalia rdhabalia added this to the 1.16 milestone Jan 6, 2017
@rdhabalia rdhabalia self-assigned this Jan 6, 2017
Copy link
Contributor

@saandrews saandrews left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

@merlimat merlimat merged commit 3a5ff46 into apache:master Jan 9, 2017
@rdhabalia rdhabalia deleted the bk_read branch January 18, 2017 21:55
sijie added a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
cbornet pushed a commit to cbornet/pulsar that referenced this pull request Feb 22, 2023
* Enable Github Actions for 2.10_ds pull requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants