Skip to content

[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
hx235:fix_earliest_seqno_zero_bug
Closed

[Draft] Fix a bug where new memtable's earliest seqno is set to incorrect VersionSet::last_sequence in DB::Reopen()#10812
hx235 wants to merge 3 commits intofacebook:mainfrom
hx235:fix_earliest_seqno_zero_bug

Conversation

@hx235
Copy link
Copy Markdown
Contributor

@hx235 hx235 commented Oct 12, 2022

Context/Summary:
Running #10776 failed OutputPathId/DBTestUniversalManualCompactionOutputPathId.ManualCompactionOutputPathId/0,1 like 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::CreateColumnFamily in VersionEditHandlerBase::Initialize() in DB::Reopen() with version_set's last_sequence at the time as the memtable's earliest seqno.
(2) However version_set's last_sequence will be updated later to reflect the correct last_sequence in VersionEditHandlerBase::CheckIterationResult(). So the last_sequence used in step (1) is not correct and the bug is that we didn't correct such memtable's earliest seqno that used the incorrect last_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,1 couldn't include some files in CompactRange() as it should.

Therefore this PR correct such memtable's earliest seqno used the incorrect last_sequence to use the correct last_sequence after the update

Test:

  • make check
  • stress test

@hx235 hx235 changed the title [Draft]Fix earliest seqno zero bug [Draft] Fix a bug where new memtable's earliest seqno is set to incorrect VersionSet::last_sequence in DB::Reopen() Oct 12, 2022
@hx235 hx235 closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants