Skip to content

Fix explicitLac race restoring deleted ledgers#4840

Open
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-explicitlac-race-restoring-ledgers
Open

Fix explicitLac race restoring deleted ledgers#4840
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-explicitlac-race-restoring-ledgers

Conversation

@void-ptr974

Copy link
Copy Markdown
Contributor

Motivation

LedgerMetadataIndex.setExplicitLac() updates ledger metadata without taking the per-ledger lock used by delete. A concurrent delete can remove the ledger after setExplicitLac() reads it, then setExplicitLac() can put the ledger back into the in-memory index.

Changes

  • Serialize explicitLac updates with other per-ledger metadata changes.
  • Add a regression test for concurrent explicitLac update and delete.

Tests

  • mvn -pl bookkeeper-server -DskipTests=false -Dtest=LedgerMetadataIndexTest test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant