[Draft] Fix a bug where new memtable's earliest seqno is set to incorrect VersionSet::last_sequence in DB::Reopen()#10812
Closed
hx235 wants to merge 3 commits intofacebook:mainfrom
Closed
Conversation
…erlapping L0 file seqnos
…pdated in DB::Reopen()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context/Summary:
Running #10776 failed
OutputPathId/DBTestUniversalManualCompactionOutputPathId.ManualCompactionOutputPathId/0,1like https://app.circleci.com/pipelines/github/facebook/rocksdb/19859/workflows/ce78a15b-ad94-4d01-b532-fe824734374a/jobs/507374.This revealed a bug described as following:
(1) We create a memtable in
VersionSet::CreateColumnFamilyinVersionEditHandlerBase::Initialize()inDB::Reopen()with version_set'slast_sequenceat the time as the memtable's earliest seqno.(2) However version_set's
last_sequencewill be updated later to reflect the correctlast_sequenceinVersionEditHandlerBase::CheckIterationResult(). So thelast_sequenceused in step (1) is not correct and the bug is that we didn't correct such memtable's earliest seqno that used the incorrectlast_sequence(3) Therefore for later operation that relies on this memtable's earliest seqno will output incorrect result, like how running PR10776 on
OutputPathId/DBTestUniversalManualCompactionOutputPathId.ManualCompactionOutputPathId/0,1couldn't include some files inCompactRange()as it should.Therefore this PR correct such memtable's earliest seqno used the incorrect
last_sequenceto use the correctlast_sequenceafter the updateTest: