Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

ISSUE #870: ScanAndCompareGarbageCollector: harden against LM bugs - #22

Merged
revans2 merged 1 commit into
YahooArchive:yahoo-4.3from
revans2:ISSUE-870-HARDENING
Feb 20, 2018
Merged

revans2 merged 1 commit into
YahooArchive:yahoo-4.3from
revans2:ISSUE-870-HARDENING

Conversation

@revans2

@revans2 revans2 commented Feb 7, 2018

Copy link
Copy Markdown
Collaborator

This is a port of apache#870

The idea behind this patch is to make it more likely that more than one
LedgerManager bug would be required to erroneously believe a ledger to be
deleted.
1) Remove the special handling for the completely empty LM.  It's not
really a common case nor is it much of an optimization even when it
happens.
2) Add a config variable to cause the bookie to also check the
LedgerManager.readLedgerMetadata path before actually removing a ledger.
The implementations of readLedgerMetadata and the iterator are
sufficiently different that it seems worth it to have the option of
checking both to guard somewhat against a bug in either.

(bug W-4292747)
(bug W-3027938)
Signed-off-by: Samuel Just <sjustsalesforce.com>
Signed-off-by: Charan Reddy Guttapalem <cguttapalemsalesforce.com>

Master Issue: apache#870

Author: Samuel Just <[email protected]>

Reviewers: Ivan Kelly <[email protected]>, Arvin <None>, Sijie Guo <[email protected]>

This closes apache#876 from athanatos/forupstream/issue-870, closes apache#870

@agresch agresch left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Possible further tests for completeness, but I'm fine with it as is.

* in this test scenario no created ledger is deleted, but ledgeriterator is screwed up and returns hasNext to be
* false and next to be null. So even in this case it is expected not to clean any ledger's data.
*
* This testcase is needed for validating fix of bug - W-4292747.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is this a valid tracking issue? How does one find it if so?

validateLedgerRangeIterator(createdLedgers);

garbageCollector.gc(cleaner);
assertTrue("Should have cleaned nothing", cleaned.isEmpty());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are there any tests with baseConf.setVerifyMetadataOnGc(true) that actually do any cleaning, just to validate it doesn't disable cleaning altogether?

* This testcase is needed for validating fix of bug - W-4292747.
*
* ScanAndCompareGarbageCollector/GC should clean data of ledger only if both the LedgerManager.getLedgerRanges says
* that ledger is not existing and also ledgerManager.readLedgerMetadata fails with error

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

possibly add this test with baseConf.setVerifyMetadataOnGc(false) to validate existing functionality remains the same?

@kishorvpatil kishorvpatil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@rdhabalia rdhabalia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@revans2
revans2 merged commit 0516119 into YahooArchive:yahoo-4.3 Feb 20, 2018
rdhabalia pushed a commit to rdhabalia/bookkeeper that referenced this pull request Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants