-
Notifications
You must be signed in to change notification settings - Fork 104
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
Resolve #2526: Index Scrubbing: eliminate missing record exception for dangl… #2527
base: main
Are you sure you want to change the base?
Resolve #2526: Index Scrubbing: eliminate missing record exception for dangl… #2527
Conversation
Result of fdb-record-layer-pr on Linux CentOS 7
|
4c2df49
to
5708488
Compare
Result of fdb-record-layer-pr on Linux CentOS 7
|
5708488
to
9a1e95e
Compare
Result of fdb-record-layer-pr on Linux CentOS 7
|
Result of fdb-record-layer-pr on Linux CentOS 7
|
final boolean isDangling = ((findException(ex, RecordDoesNotExistException.class) != null) || | ||
(syntheticRecord != null && syntheticRecord.getConstituents().isEmpty())); | ||
if (isDangling) { | ||
// None of the constituents of this synthetic type are present, so it must be dangling |
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.
I believe this will identify anything where any of the constituents is not found as dangling, which is different from the comment. It probably is the case that we want that behavior, I think.
It is a bit weird that this uses exception handling as control flow, though. If we wanted to fix that, I think we'd need a new variant of loadSyntheticRecord
that takes an IndexOrphanBehavior
argument, or something like that.
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.
✅
Assertions.assertTrue(0 < timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_SCANNED)); | ||
assertEquals(0, timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_INDEXED)); | ||
Assertions.assertTrue(0 < timer.getCount(FDBStoreTimer.Counts.INDEX_SCRUBBER_DANGLING_ENTRIES)); | ||
assertEquals(0, timer.getCount(FDBStoreTimer.Counts.INDEX_SCRUBBER_MISSING_ENTRIES)); |
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.
It would probably be nice to extend this test so that we validate that it will delete the dangling entries if setAllowRepair
is true
and that that results in a clean index (similar to what the equivalent test for missing entries does).
indexScrubber.scrubMissingIndexEntries(); | ||
} | ||
Assertions.assertTrue(0 < timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_SCANNED)); |
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.
I think we can be more precise with this assertion. At the very least, this should be:
assertThat(timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_SCANNED), greaterThan(0));
To make the assertion a little more readable, but we actually know the expected number of records to scan should be 5 * numRecords
, I think
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.
✅
Assertions.assertTrue(0 < timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_SCANNED)); | ||
assertEquals(0, timer.getCount(FDBStoreTimer.Counts.ONLINE_INDEX_BUILDER_RECORDS_INDEXED)); | ||
Assertions.assertTrue(0 < timer.getCount(FDBStoreTimer.Counts.INDEX_SCRUBBER_DANGLING_ENTRIES)); | ||
assertEquals(0, timer.getCount(FDBStoreTimer.Counts.INDEX_SCRUBBER_MISSING_ENTRIES)); |
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.
In theory, we could do with an additional test here that validates the behavior if there's a join index and one (but not all) of the constituents is deleted. I believe, as written, it will identify those as dangling (and I think that's right)
…on for dangling synthetic index entries
1a6440b
to
6b95749
Compare
Result of fdb-record-layer-pr on Linux CentOS 7
|
…ing synthetic index entries.