Skip to content

ScanAndCompareGarbageCollector.gc: harden against LedgerManager bugs #870

Closed

Description

@athanatos

There is special logic in gc() for handling the case where ledgerRangeIterator.hasNext() returns false immediately (the case where the LedgerManager is empty). The logic immediately deletes all of the indices which were present prior to the iterator call. Strictly speaking, this is correct, but segregating the handling of this case from the handling of (for instance) the case where there is 1 ledger means that we unnecessarily duplicate the removal logic and, in this case, skip the part where we double check that the metadata really is absent. Refactor this method to use the same logic in both cases.

More generally, add a config to force the bookie to use both the iterator and the readLedgerMetadata paths to prove a ledger is really dead.

I'll have a PR up for this in the next few days.

Activity

  1. changed the title [-]ScanAndCompareGarbageCollector.gc: do not short-circuit the second metadata check[/-] [+]ScanAndCompareGarbageCollector.gc: harden against LedgerManager bugs[/+] on Dec 16, 2017
  2. added 5 commits that reference this issue on Dec 18, 2017
  3. added this to the 4.7.0 milestone on Dec 27, 2017
  4. added a commit that references this issue on Dec 27, 2017
  5. added 2 commits that reference this issue on Feb 7, 2018
  6. added a commit that references this issue on Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions