-
Notifications
You must be signed in to change notification settings - Fork 903
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
AutoRecovery supports batch read #4211
AutoRecovery supports batch read #4211
Conversation
@horizonzy I introduced batch reading for auto-recovery, please help take a look, thanks. |
} | ||
toSend.release(); | ||
} | ||
if (lastEntryId == endEntryId) { |
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.
When lastEntryId == endEntryId
, we needn't callback ledgerFragmentMcb.processResult(BKException.Code.OK, null, null);
.
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.
Good point! Updated
LOG.error("BK error reading ledger entries: {} - {}", | ||
startEntryId, endEntryId, BKException.create(rc)); | ||
onReadEntryFailureCallback.accept(lh.getId(), startEntryId); | ||
ledgerFragmentMcb.processResult(rc, null, null); |
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.
The ledgerFragmentMcb
is MultiCallback
, when batch read fails, the processResult
invoke count may be not enough.
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.
Good point. Updated.
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.
LGTM.
* AutoRecovery support batch read * Fix check style * address comments
Motivation
We support batch reading in BP-62 and auto-recovery is the best case to support this feature. This PR supports batch reading for auto-recovery and introduces a flag
recoveryBatchReadEnabled
to enable batch reading for auto-recoveryChanges
We introduce a flag
recoveryBatchReadEnabled
to enable batch reading for auto-recovery.