Skip to content

Enable unit test PrecludeLastLevelTest.RangeDelsCauseFileEndpointsToOverlap - #12064

Closed
cbi42 wants to merge 1 commit into
meta:mainfrom
cbi42:enable-test
Closed

cbi42 wants to merge 1 commit into
meta:mainfrom
cbi42:enable-test

Conversation

@cbi42

@cbi42 cbi42 commented Nov 12, 2023

Copy link
Copy Markdown
Contributor

Fixes #11909. The test passes after the change in #11917 to start mock clock from a non-zero time.

The reason for test failing is a bit complicated:

L5: file 1 [K5@20, K10@kMaxSeqno], file 2 [K10@30, K14@34)
L6: file 3 [K6@5, K10@20]

#12063 will add fixes to check internal key range when compacting keys from last level up to the penultimate level.

Test plan: the unit test passes

@cbi42 cbi42 changed the title Enable test PrecludeLastLevelTest.RangeDelsCauseFileEndpointsToOverlap Enable unit test PrecludeLastLevelTest.RangeDelsCauseFileEndpointsToOverlap Nov 12, 2023

@ajkr ajkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense, thanks

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cbi42 merged this pull request in e7896f0.

Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
…Overlap` (meta#12064)

Summary:
Fixes meta#11909. The test passes after the change in meta#11917 to start mock clock from a non-zero time.

The reason for test failing is a bit complicated:
- The Put here https://github.com/pdillinger/rocksdb/blob/e4ad4a0ef1b852dc203311fb885c673c891f08e0/db/compaction/tiered_compaction_test.cc#L2045 happens before mock clock advances beyond 0.
- This causes oldest_key_time_ to be 0 for memtable.
- oldest_ancester_time of the first L0 file becomes 0
- L0 -> L5/6 compaction output files sets `oldest_ancestoer_time` to the current time due to these lines: https://github.com/facebook/rocksdb/blob/e9c5eb70d180fe0a1b80f91998c084e40714c23b/db/compaction/compaction_job.cc#L1898C34-L1904.
- This causes some small sequence number to be mapped to current time: https://github.com/facebook/rocksdb/blob/e9c5eb70d180fe0a1b80f91998c084e40714c23b/db/compaction/compaction_job.cc#L301
- Keys in L6 is being moved up to L5 due to the unexpected seqno_to_time mapping
- When compacting keys from last level to the penultimate level, we only check keys to be within user key range of penultimate level input files. If we compact the following file 3 with file 1 and output keys to L5, we can get the reported inconsistency bug.
```
L5: file 1 [K5@20, K10@kMaxSeqno], file 2 [K10@30, K14@34)
L6: file 3 [K6@5, K10@20]
```

meta#12063 will add fixes to check internal key range when compacting keys from last level up to the penultimate level.

Pull Request resolved: meta#12064

Test Plan: the unit test passes

Reviewed By: ajkr

Differential Revision: D51281149

Pulled By: cbi42

fbshipit-source-id: 00b7f026c453454d9f3af5b2de441383a96f0c62
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.

Compaction error in PrecludeLastLevelTest::RangeDelsCauseFileEndpointsToOverlap

3 participants