Skip to content

Rework, simplify some tiering logic for mutable options - #13256

Closed
pdillinger wants to merge 5 commits into
meta:mainfrom
pdillinger:preserve_preclude_mutable2
Closed

pdillinger wants to merge 5 commits into
meta:mainfrom
pdillinger:preserve_preclude_mutable2

Conversation

@pdillinger

@pdillinger pdillinger commented Dec 27, 2024 •

Copy link
Copy Markdown
Contributor

Summary: The primary goal of this change was to support full dynamic mutability of options preclude_last_level_data_seconds and preserve_internal_time_seconds, which was challenging because of subtle design holes referenced from #13124.

The fix is, in a sense, "doubling down" on the idea of write-time-based tiering, by simplifying the output level decision with a single sequence number threshold. This approach has some advantages:

  • Allows option mutability in presence of long snapshots (or UDT)
  • Simpler to believe correct because there's no special treatment for range tombstones, and output level assignment does not affect sequence number assignment to the entries (which takes some care to avoid circular dependency; see CompactionIterator stuff below).
  • Avoids extra key comparisons, in WithinPenultimateLevelOutputRange(), in relevant compactions (more CPU efficient, though untested).

There are two big pieces/changes to enable this simplification to a single penultimate_after_seqno_ threshold:

  • Allow range tombstones to be sent to either output level, based on sequence number.
  • Use sequence numbers instead of range checks to avoid data in the last level from moving to penultimate level outside of the permissable range on that level (due to compaction selecting wider range in the later input level, which is the normal output level). With this change, data can only move "back up the LSM" when entire sorted runs are selected for comapction.

Possible disadvantages:

  • Extra CPU to iterate over range tombstones in relevant compactions twice instead of once. However, work loads with lots of range tombstones relative to other entries should be rare.
  • Data might not migrate back up the LSM tree on option changes as aggressively or consistently. This should a a rare concern, however, especially for universal compaction where selecting full sorted runs is normal compaction.
  • This approach is arguably "further away from" a design that allows for other kinds of output level placement decisions, such as range-based input data hotness. However, properly handling range tombstones with such policies will likely require flexible placement into outputs, as this change introduces.

Additional details:

  • For good code abstraction, separate CompactionIterator from the concern of where to place compaction outputs. CompactionIterator is supposed to provide a stream of entries, including the "best" sequence number we can assign to those entries. If it's safe and proper to zero out a sequence number, the placement of entries to outputs should deal with that safely rather than having complex inter-dependency between sequence number assignment and placement. To achieve this, we migrate all the compaction output placement logic that was in CompactionIterator to CompactionJob and similar. This unfortunately renders some unit tests (PerKeyPlacementCompIteratorTest) depending on the bad abstraction as obsolete, but tiered_compaction_test has pretty good coverage overall, catching many issues during this development.

Intended follow-up:

  • See FIXME items in tiered_compaction_test
  • More testing / validation / support for tiering + UDT
  • Consider generalizing this work to split results at other levels as appropriate based on stats (auto-tuning essentially). Allowing only the last level to be cold is limiting.

Test Plan: tests were added in previous changes (#13244 #13124), and updated here to reflect correct operation (with some known problems for leveled compaction)

Summary: The primary goal of this change was to support full dynamic
mutability of options `preclude_last_level_data_seconds` and
`preserve_internal_time_seconds`, which was challenging because of
subtle design holes referenced from meta#13124.

The fix is, in a sense, "doubling down" on the idea of write-time-based
tiering, by simplifying the output level decision with a single sequence
number threshold. This approach has some advantages:
* Allows option mutability in presence of long snapshots (or UDT)
* Simpler to believe correct because there's no special treatment for
  range tombstones, and output level assignment does not affect sequence
  number assignment to the entries (which takes some care to avoid
  circular dependency; see CompactionIterator stuff below).
* Avoids extra key comparisons, in `WithinPenultimateLevelOutputRange()`,
  in relevant compactions (more CPU efficient, though untested).

There are two big pieces/changes to enable this simplification to a
single `penultimate_after_seqno_` threshold:
* Allow range tombstones to be sent to either output level, based on
  sequence number.
* Use sequence numbers instead of range checks to avoid data in the last
  level from moving to penultimate level outside of the permissable
  range on that level (due to compaction selecting wider range in the
  later input level, which is the normal output level). With this
  change, data can only move "back up the LSM" when entire sorted runs
  are selected for comapction.

Possible disadvantages:
* Extra CPU to iterate over range tombstones in relevant compactions
  *twice* instead of once. However, work loads with lots of range tombstones
  relative to other entries should be rare.
* Data might not migrate back up the LSM tree on option changes as
  aggressively or consistently. This should a a rare concern, however,
  especially for universal compaction where selecting full sorted runs
  is normal compaction.
* This approach is arguably "further away from" a design that allows for
  other kinds of output level placement decisions, such as range-based
  input data hotness. However, properly handling range tombstones with
  such policies will likely require flexible placement into outputs,
  as this change introduces.

Additional details:
* For good code abstraction, separate CompactionIterator from the
  concern of where to place compaction outputs. CompactionIterator is
  supposed to provide a stream of entries, including the "best" sequence
  number we can assign to those entries. If it's safe and proper to zero
  out a sequence number, the placement of entries to outputs should deal
  with that safely rather than having complex inter-dependency between
  sequence number assignment and placement. To achieve this, we migrate
  all the compaction output placement logic that was in CompactionIterator
  to CompactionJob and similar. This unfortunately renders some unit
  tests (PerKeyPlacementCompIteratorTest) depending on the bad
  abstraction as obsolete, but tiered_compaction_test has pretty good
  coverage overall, catching many issues during this development.

Intended follow-up:
* See FIXME items in tiered_compaction_test
* More testing / validation / support for tiering + UDT
* Consider generalizing this work to split results at other levels as
  appropriate based on stats (auto-tuning essentially). Allowing only the
  last level to be cold is limiting.

Test Plan: tests were added in previous changes (meta#13244 meta#13124), and
updated here to reflect correct operation (with some known problems for
leveled compaction)
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

@cbi42 cbi42 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.

LGTM! Thanks for making this difficult fix.

Comment thread db/compaction/compaction_outputs.cc Outdated
auto tombstone = it->Tombstone();
auto kv = tombstone.Serialize();
// Filter out by seqno for per-key placement
// TODO: should this go lower down?

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.

I think here is fine since this is not actually "dropping" a tombstone but just to assign to a different level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My concern was overlooking some local state in this function that might be relevant to processing tombstones going to the other output level. I'll re-inspect and remove the comment if it still looks ok.

Comment thread db/internal_stats.h Outdated
this->num_output_files_blob += stats.num_output_files_blob;
}

bool IsEmpty() const {

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.

not used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, this was going to be used, then not. ;)

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@pdillinger has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@pdillinger 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

@pdillinger merged this pull request in 631b679.

ybtsdst pushed a commit to ybtsdst/rocksdb that referenced this pull request Apr 27, 2025
Summary:
The primary goal of this change was to support full dynamic mutability of options `preclude_last_level_data_seconds` and `preserve_internal_time_seconds`, which was challenging because of subtle design holes referenced from meta#13124.

The fix is, in a sense, "doubling down" on the idea of write-time-based tiering, by simplifying the output level decision with a single sequence number threshold. This approach has some advantages:
* Allows option mutability in presence of long snapshots (or UDT)
* Simpler to believe correct because there's no special treatment for range tombstones, and output level assignment does not affect sequence number assignment to the entries (which takes some care to avoid circular dependency; see CompactionIterator stuff below).
* Avoids extra key comparisons, in `WithinPenultimateLevelOutputRange()`, in relevant compactions (more CPU efficient, though untested).

There are two big pieces/changes to enable this simplification to a single `penultimate_after_seqno_` threshold:
* Allow range tombstones to be sent to either output level, based on sequence number.
* Use sequence numbers instead of range checks to avoid data in the last level from moving to penultimate level outside of the permissable range on that level (due to compaction selecting wider range in the later input level, which is the normal output level). With this change, data can only move "back up the LSM" when entire sorted runs are selected for comapction.

Possible disadvantages:
* Extra CPU to iterate over range tombstones in relevant compactions *twice* instead of once. However, work loads with lots of range tombstones relative to other entries should be rare.
* Data might not migrate back up the LSM tree on option changes as aggressively or consistently. This should a a rare concern, however, especially for universal compaction where selecting full sorted runs is normal compaction.
* This approach is arguably "further away from" a design that allows for other kinds of output level placement decisions, such as range-based input data hotness. However, properly handling range tombstones with such policies will likely require flexible placement into outputs, as this change introduces.

Additional details:
* For good code abstraction, separate CompactionIterator from the concern of where to place compaction outputs. CompactionIterator is supposed to provide a stream of entries, including the "best" sequence number we can assign to those entries. If it's safe and proper to zero out a sequence number, the placement of entries to outputs should deal with that safely rather than having complex inter-dependency between sequence number assignment and placement. To achieve this, we migrate all the compaction output placement logic that was in CompactionIterator to CompactionJob and similar. This unfortunately renders some unit tests (PerKeyPlacementCompIteratorTest) depending on the bad abstraction as obsolete, but tiered_compaction_test has pretty good coverage overall, catching many issues during this development.

Intended follow-up:
* See FIXME items in tiered_compaction_test
* More testing / validation / support for tiering + UDT
* Consider generalizing this work to split results at other levels as appropriate based on stats (auto-tuning essentially). Allowing only the last level to be cold is limiting.

Pull Request resolved: meta#13256

Test Plan: tests were added in previous changes (meta#13244 meta#13124), and updated here to reflect correct operation (with some known problems for leveled compaction)

Reviewed By: cbi42

Differential Revision: D67683210

Pulled By: pdillinger

fbshipit-source-id: ca3f2bbc2fcc6891516a2a4220f1b0da09af5ade
meta-codesync Bot pushed a commit that referenced this pull request May 29, 2026
…4795)

Summary:
Fixes an off-by-one bug in how sequence numbers are handled when splitting range tombstones across output levels in per-key-placement (tiered) compaction. The bug was either introduced or propagated in #13256.

Point entries move to proximal output only when their sequence number is strictly greater than `proximal_after_seqno_`, but range tombstones were previously split using an inclusive lower bound at that same seqno. That allowed a range tombstone at the boundary to be emitted to the proximal level while point keys at the same seqno stayed in the last level, which could create overlapping files in the proximal level (caught by `force_consistency_checks` as `L<n> has overlapping ranges`).

This matters when `proximal_output_range_type_` is `kNonLastRange`: the compaction only owns the selected proximal-level input range, so existing last-level data at the split boundary must stay in the last level. In `kFullRange`, the compaction owns the relevant proximal-level range, so newer last-level data can be safely emitted to proximal output.

The fix splits range tombstones at `proximal_after_seqno_ + 1` (saturating at `kMaxSequenceNumber`), so the half-open `[lower, upper)` tombstone filter lands on the same boundary as the strict `seqno > proximal_after_seqno_` rule used for point keys.

Pull Request resolved: #14795

Test Plan:
New regression test `PrecludeLastLevelTestBase.RangeDelAtProximalSeqnoBoundaryStaysInLastLevel` uses a targeted manual compaction to exercise the `kNonLastRange` case directly, verifying a boundary range tombstone stays in the last level instead of widening the proximal output range.

Worked example:

```text
Initial state:

  L6 (last level):   Put(Key 2)s1,  Put(Key 12)s2,  RangeDel[Key 2, Key 12)s3
  L5 (proximal):     file A [Key 0 .. Key 4]s4-s5     file B [Key 5 .. Key 9]s6-s7

  preclude_last_level_min_seqno is forced to 0 via sync point.

Manual CompactFiles selects only L5 file B + the L6 file (output level 6).
Only part of the proximal level is selected, so this is the kNonLastRange case:

  max_last_level_seqno  = 3
  proximal_after_seqno_ = max(0, 3) = 3

  Point keys Key 5 (s6) and Key 9 (s7): both seqno > 3 -> proximal output (L5)   OK

  Range tombstone s3:
    Old (buggy):  proximal keep range [3, MAX) includes s3, so the tombstone is
                  emitted to the proximal output. The output is built from L5 input
                  file B [Key 5 .. Key 9], but the tombstone covers [Key 2, Key 12),
                  so the proximal output file starts at Key 2 and spills past Key 5
                  into the existing, untouched L5 file A [Key 0 .. Key 4].
                  Two overlapping files in L5 -> Corruption.

    New (fixed):  split at proximal_after_seqno_ + 1 = 4.
                  proximal keep [4, MAX) excludes s3; last-level keep [0, 4) includes
                  s3 -> tombstone stays in the last level (L6).   OK
```

Verification (debug build, `make -j64 tiered_compaction_test`):

- Without the fix, the test fails at the `CompactFiles` call:
  ```
  tiered_compaction_test.cc:2940: Failure
  Corruption: force_consistency_checks(DEBUG): VersionBuilder: L5 has overlapping ranges:
    file #11 largest key: Key(4) seq:5, type:1 (Put) vs.
    file #17 smallest key: Key(2) seq:3, type:15 (range deletion)
  ```
- With the fix, the test passes (range deletions absent from L5, still present in L6).

Reviewed By: pdillinger

Differential Revision: D106528471

Pulled By: joshkang97

fbshipit-source-id: a5f99b426d3a7a6253bc1972cf8cb60d1cb85089
Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
Summary:
The primary goal of this change was to support full dynamic mutability of options `preclude_last_level_data_seconds` and `preserve_internal_time_seconds`, which was challenging because of subtle design holes referenced from meta#13124.

The fix is, in a sense, "doubling down" on the idea of write-time-based tiering, by simplifying the output level decision with a single sequence number threshold. This approach has some advantages:
* Allows option mutability in presence of long snapshots (or UDT)
* Simpler to believe correct because there's no special treatment for range tombstones, and output level assignment does not affect sequence number assignment to the entries (which takes some care to avoid circular dependency; see CompactionIterator stuff below).
* Avoids extra key comparisons, in `WithinPenultimateLevelOutputRange()`, in relevant compactions (more CPU efficient, though untested).

There are two big pieces/changes to enable this simplification to a single `penultimate_after_seqno_` threshold:
* Allow range tombstones to be sent to either output level, based on sequence number.
* Use sequence numbers instead of range checks to avoid data in the last level from moving to penultimate level outside of the permissable range on that level (due to compaction selecting wider range in the later input level, which is the normal output level). With this change, data can only move "back up the LSM" when entire sorted runs are selected for comapction.

Possible disadvantages:
* Extra CPU to iterate over range tombstones in relevant compactions *twice* instead of once. However, work loads with lots of range tombstones relative to other entries should be rare.
* Data might not migrate back up the LSM tree on option changes as aggressively or consistently. This should a a rare concern, however, especially for universal compaction where selecting full sorted runs is normal compaction.
* This approach is arguably "further away from" a design that allows for other kinds of output level placement decisions, such as range-based input data hotness. However, properly handling range tombstones with such policies will likely require flexible placement into outputs, as this change introduces.

Additional details:
* For good code abstraction, separate CompactionIterator from the concern of where to place compaction outputs. CompactionIterator is supposed to provide a stream of entries, including the "best" sequence number we can assign to those entries. If it's safe and proper to zero out a sequence number, the placement of entries to outputs should deal with that safely rather than having complex inter-dependency between sequence number assignment and placement. To achieve this, we migrate all the compaction output placement logic that was in CompactionIterator to CompactionJob and similar. This unfortunately renders some unit tests (PerKeyPlacementCompIteratorTest) depending on the bad abstraction as obsolete, but tiered_compaction_test has pretty good coverage overall, catching many issues during this development.

Intended follow-up:
* See FIXME items in tiered_compaction_test
* More testing / validation / support for tiering + UDT
* Consider generalizing this work to split results at other levels as appropriate based on stats (auto-tuning essentially). Allowing only the last level to be cold is limiting.

Pull Request resolved: meta#13256

Test Plan: tests were added in previous changes (meta#13244 meta#13124), and updated here to reflect correct operation (with some known problems for leveled compaction)

Reviewed By: cbi42

Differential Revision: D67683210

Pulled By: pdillinger

fbshipit-source-id: ca3f2bbc2fcc6891516a2a4220f1b0da09af5ade
Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
…ta#14795)

Summary:
Fixes an off-by-one bug in how sequence numbers are handled when splitting range tombstones across output levels in per-key-placement (tiered) compaction. The bug was either introduced or propagated in meta#13256.

Point entries move to proximal output only when their sequence number is strictly greater than `proximal_after_seqno_`, but range tombstones were previously split using an inclusive lower bound at that same seqno. That allowed a range tombstone at the boundary to be emitted to the proximal level while point keys at the same seqno stayed in the last level, which could create overlapping files in the proximal level (caught by `force_consistency_checks` as `L<n> has overlapping ranges`).

This matters when `proximal_output_range_type_` is `kNonLastRange`: the compaction only owns the selected proximal-level input range, so existing last-level data at the split boundary must stay in the last level. In `kFullRange`, the compaction owns the relevant proximal-level range, so newer last-level data can be safely emitted to proximal output.

The fix splits range tombstones at `proximal_after_seqno_ + 1` (saturating at `kMaxSequenceNumber`), so the half-open `[lower, upper)` tombstone filter lands on the same boundary as the strict `seqno > proximal_after_seqno_` rule used for point keys.

Pull Request resolved: meta#14795

Test Plan:
New regression test `PrecludeLastLevelTestBase.RangeDelAtProximalSeqnoBoundaryStaysInLastLevel` uses a targeted manual compaction to exercise the `kNonLastRange` case directly, verifying a boundary range tombstone stays in the last level instead of widening the proximal output range.

Worked example:

```text
Initial state:

  L6 (last level):   Put(Key 2)s1,  Put(Key 12)s2,  RangeDel[Key 2, Key 12)s3
  L5 (proximal):     file A [Key 0 .. Key 4]s4-s5     file B [Key 5 .. Key 9]s6-s7

  preclude_last_level_min_seqno is forced to 0 via sync point.

Manual CompactFiles selects only L5 file B + the L6 file (output level 6).
Only part of the proximal level is selected, so this is the kNonLastRange case:

  max_last_level_seqno  = 3
  proximal_after_seqno_ = max(0, 3) = 3

  Point keys Key 5 (s6) and Key 9 (s7): both seqno > 3 -> proximal output (L5)   OK

  Range tombstone s3:
    Old (buggy):  proximal keep range [3, MAX) includes s3, so the tombstone is
                  emitted to the proximal output. The output is built from L5 input
                  file B [Key 5 .. Key 9], but the tombstone covers [Key 2, Key 12),
                  so the proximal output file starts at Key 2 and spills past Key 5
                  into the existing, untouched L5 file A [Key 0 .. Key 4].
                  Two overlapping files in L5 -> Corruption.

    New (fixed):  split at proximal_after_seqno_ + 1 = 4.
                  proximal keep [4, MAX) excludes s3; last-level keep [0, 4) includes
                  s3 -> tombstone stays in the last level (L6).   OK
```

Verification (debug build, `make -j64 tiered_compaction_test`):

- Without the fix, the test fails at the `CompactFiles` call:
  ```
  tiered_compaction_test.cc:2940: Failure
  Corruption: force_consistency_checks(DEBUG): VersionBuilder: L5 has overlapping ranges:
    file meta#11 largest key: Key(4) seq:5, type:1 (Put) vs.
    file meta#17 smallest key: Key(2) seq:3, type:15 (range deletion)
  ```
- With the fix, the test passes (range deletions absent from L5, still present in L6).

Reviewed By: pdillinger

Differential Revision: D106528471

Pulled By: joshkang97

fbshipit-source-id: a5f99b426d3a7a6253bc1972cf8cb60d1cb85089
jaykorean added a commit to jaykorean/rocksdb that referenced this pull request Nov 9, 2026
Summary:

Why: the tiered storage crash test (`--test_tiered_storage`) never runs leveled compaction. When no compaction style is requested, `db_crashtest.py` picks universal for tiered runs, with a TODO to enable tiered+leveled once "Corruption: Unsafe to store Seq later than snapshot" is fixed. That error came from per-key placement in leveled compaction with snapshots (see T187570195), and D67683210 (meta#13256, Jan 2025) removed it by reworking output-level placement around a single sequence number threshold. The error string no longer exists in the code base and `PrecludeWithCompactStyleTest` covers the formerly failing limited-range compaction for both styles. Leveled compaction with `preclude_last_level_data_seconds` / `last_level_temperature` is a supported configuration, but it only gets unit-test coverage today.

Previous behavior: blackbox tiered runs always used universal compaction. Whitebox tiered runs used universal for the kill and normal check modes, plus the dedicated universal and FIFO modes.

New behavior: when `compaction_style` is not given, a tiered crash-test series picks leveled or universal (50/50) once in `gen_cmd_params()`, so the style stays fixed for every run in the series. Whitebox still adds its universal and FIFO check modes, and the existing `destroy_db_initially` handling covers style transitions. Non-tiered runs are unchanged (leveled).

Safety and limitations: test-only change. The remaining leveled gap noted in `tiered_compaction_test` (`FIXME: doesn't yet work with leveled compaction`) is about how aggressively data migrates back out of the last level after a preclude option change; it affects placement, not correctness, and the crash test does not verify placement.

Landing order: stacked on D129457762, the fix for the RegisterCompaction overlap assertion this change exposed (T296653904). Land D129457762 first.

Requested by: Jay Huh (jewoongh)

Differential Revision: D129451754
jaykorean added a commit to jaykorean/rocksdb that referenced this pull request Nov 9, 2026
Summary:

Why: the tiered storage crash test (`--test_tiered_storage`) never runs leveled compaction. When no compaction style is requested, `db_crashtest.py` picks universal for tiered runs, with a TODO to enable tiered+leveled once "Corruption: Unsafe to store Seq later than snapshot" is fixed. That error came from per-key placement in leveled compaction with snapshots (see T187570195), and D67683210 (meta#13256, Jan 2025) removed it by reworking output-level placement around a single sequence number threshold. The error string no longer exists in the code base and `PrecludeWithCompactStyleTest` covers the formerly failing limited-range compaction for both styles. Leveled compaction with `preclude_last_level_data_seconds` / `last_level_temperature` is a supported configuration, but it only gets unit-test coverage today.

Previous behavior: blackbox tiered runs always used universal compaction. Whitebox tiered runs used universal for the kill and normal check modes, plus the dedicated universal and FIFO modes.

New behavior: when `compaction_style` is not given, a tiered crash-test series picks leveled or universal (50/50) once in `gen_cmd_params()`, so the style stays fixed for every run in the series. Whitebox still adds its universal and FIFO check modes, and the existing `destroy_db_initially` handling covers style transitions. Non-tiered runs are unchanged (leveled).

Safety and limitations: test-only change. The remaining leveled gap noted in `tiered_compaction_test` (`FIXME: doesn't yet work with leveled compaction`) is about how aggressively data migrates back out of the last level after a preclude option change; it affects placement, not correctness, and the crash test does not verify placement.

Landing order: stacked on D129457762, the fix for the RegisterCompaction overlap assertion this change exposed (T296653904). Land D129457762 first.

Requested by: Jay Huh (jewoongh)

___

landed-with-radar-review

Differential Revision: D129451754
meta-codesync Bot pushed a commit that referenced this pull request Nov 9, 2026
Summary:
Pull Request resolved: #15628

Why: the tiered storage crash test (`--test_tiered_storage`) never runs leveled compaction. When no compaction style is requested, `db_crashtest.py` picks universal for tiered runs, with a TODO to enable tiered+leveled once "Corruption: Unsafe to store Seq later than snapshot" is fixed. That error came from per-key placement in leveled compaction with snapshots (see T187570195), and D67683210 (#13256, Jan 2025) removed it by reworking output-level placement around a single sequence number threshold. The error string no longer exists in the code base and `PrecludeWithCompactStyleTest` covers the formerly failing limited-range compaction for both styles. Leveled compaction with `preclude_last_level_data_seconds` / `last_level_temperature` is a supported configuration, but it only gets unit-test coverage today.

Previous behavior: blackbox tiered runs always used universal compaction. Whitebox tiered runs used universal for the kill and normal check modes, plus the dedicated universal and FIFO modes.

New behavior: when `compaction_style` is not given, a tiered crash-test series picks leveled or universal (50/50) once in `gen_cmd_params()`, so the style stays fixed for every run in the series. Whitebox still adds its universal and FIFO check modes, and the existing `destroy_db_initially` handling covers style transitions. Non-tiered runs are unchanged (leveled).

Safety and limitations: test-only change. The remaining leveled gap noted in `tiered_compaction_test` (`FIXME: doesn't yet work with leveled compaction`) is about how aggressively data migrates back out of the last level after a preclude option change; it affects placement, not correctness, and the crash test does not verify placement.

Landing order: stacked on D129457762, the fix for the RegisterCompaction overlap assertion this change exposed (T296653904). Land D129457762 first.

Requested by: Jay Huh (jewoongh)

___

landed-with-radar-review

Differential Revision: D129451754

fbshipit-source-id: 4dcc38f73e530402ecb37d94553a97bd9ca26b79
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.

3 participants