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

Issue 1533: DbLedgerStorage does not persist ExplicitLAC: Information (Header) of TransientLedgerInfo is not persisted #2474

Merged
merged 3 commits into from
Nov 2, 2020

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Oct 31, 2020

Motivation

DbLedgerStorage does not persist "ExplicitLAC" on RocksDB, so when you restart a Bookie the information is lost.
This work can be considered a follow up of @reddycharan work at #1527

Changes

  • persist ExplicitLAC on DBLedgerStorage
  • save ExplicitLAC on RocksDB (it is an optional field, so this change is backward compatible)
  • enable testExplicitLACIsPersisted test even for DBLedgerStorage
  • on TransientLedgerInfo rewind the ByteBuf in order to be able to use it again while writing to RocksDB
  • use computeIfAbsent in getOrAddLedgerInfo (code clean up, but code looked strange, probably subject to some possible race condition)

Master Issue: #1533

@eolivelli eolivelli requested review from merlimat, reddycharan and jiazhai and removed request for merlimat and reddycharan October 31, 2020 15:32
@eolivelli eolivelli marked this pull request as ready for review October 31, 2020 15:33
@eolivelli
Copy link
Contributor Author

@reddycharan please take a look as this is a follow up of your work
@merlimat please take a look as you are more confident with DbLedgerStorage than me

@jiazhai this is the needed fix in order to fully leverage ExplicitLAC on the new API and on Pulsar

@sijie I am not sure if we have to change also tryReadLastAddConfirmedAsync and readLastAddConfirmedAndEntryAsync, those are part of the Long-Poll feature, currently long-poll still does not benefit from ExplicitLAC

@jiazhai jiazhai merged commit 4d44650 into apache:master Nov 2, 2020
@eolivelli eolivelli deleted the fix/issue-1533-dbledger-lac branch November 3, 2020 09:56
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

2 participants