Skip to content

Long-running compactions no longer delay deleting obsolete SSTs - #15710

Closed
pdillinger wants to merge 1 commit into
meta:mainfrom
pdillinger:export-D130987455
Closed

pdillinger wants to merge 1 commit into
meta:mainfrom
pdillinger:export-D130987455

Conversation

@pdillinger

@pdillinger pdillinger commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Background

RocksDB deletes an SST file once it is obsolete, meaning no Version references it anymore, usually because a compaction replaced it. Files that a running flush or compaction is still writing are also in no Version, but they must not be deleted. To protect them, each flush or compaction records the next file number in pending_outputs_ when it starts. The obsolete-file purge then skips every SST numbered at or above the smallest recorded number (min_pending_output, exposed as rocksdb.min-obsolete-sst-number-to-keep). The purge applies this cutoff to every SST: both files found by scanning the DB directories and files that VersionSet already knows are obsolete (obsolete_files_, filled when the last Version referencing a file is destroyed).

53af5d877 ("Redesign pending_outputs_", 2014) introduced the cutoff, replacing tracking of each job's exact output file numbers. At first the cutoff was applied only in PurgeObsoleteFiles(). That leaked files: a file taken from obsolete_files_ and then held back was neither deleted nor tracked until the next full directory scan. 863009b5a ("Fix deleting obsolete files #2", 2015) fixed the leak by also applying the cutoff in VersionSet::GetObsoleteFiles(), so such files stay in obsolete_files_ until the cutoff moves past them. A FIXME left in PurgeObsoleteFiles() asks whether these files should be held back at all. More recently, #15490 stopped prepared external ingestions from holding a pending_outputs_ entry. They now protect only their reserved file numbers, so a long-lived prepared ingestion no longer holds back unrelated obsolete SSTs.

The problem

While a long-running job is in progress, obsolete SSTs pile up on disk. Every SST created after the job started and since compacted away is kept until the job finishes, even though none of them can be an unfinished output: each was part of an installed Version, so holding it back protects nothing. Usually the wait is short, but a remote compaction can wait in CompactionService::Wait() for hours or days. Under a steady write load, obsolete SSTs can then grow to many times the size of the live data and fill the disk; rocksdb.obsolete-sst-files-size shows the growth.

Previous behavior

  • GetObsoleteFiles() handed off only obsolete SSTs numbered below min_pending_output; the rest stayed in obsolete_files_.
  • PurgeObsoleteFiles() kept every SST candidate numbered at or above min_pending_output, from either source.

New behavior

The purge deletes an SST that VersionSet reports as obsolete, whatever jobs are still running, apart from a brief exception when event listeners are configured (below). GetObsoleteFiles() hands off all obsolete SSTs, and PurgeObsoleteFiles() applies the cutoff only to SST candidates that came from the directory scan. Both parts are needed: changing only GetObsoleteFiles() would bring back the 2015 leak.

Unchanged:

  • Unfinished outputs are found only by the directory scan, so the cutoff still protects them.
  • Inputs of a running compaction stay protected: the compaction holds a reference on its input Version, so they never reach obsolete_files_.
  • Live files, including trivially moved ones, are still excluded by the live-file set and only_delete_metadata.
  • Files quarantined after a failed MANIFEST write are still checked before anything else.
  • Obsolete blob files still honor the cutoff. VersionBuilder can report a blob file obsolete without it having been part of an installed Version, so the argument above does not cover them.

Keeping event listener outputs available

The cutoff also had a side effect that listeners can observe. A job removes its pending_outputs_ entry only after its OnFlushCompleted() or OnCompactionCompleted() callbacks return, so RocksDB did not delete the files those callbacks report while the callbacks ran, even if another compaction made them obsolete in the meantime. EventListener did not document this, but a listener that opens, copies, or links a reported file might depend on it. Without the cutoff for known-obsolete files, such a listener could find the file already deleted.

To keep that behavior, this change keeps a narrower form of the cutoff for known-obsolete SSTs, in DBImpl::listener_pending_outputs_. While a job might still report its outputs to listeners, its pending_outputs_ number is also registered there, and GetObsoleteFiles() leaves obsolete SSTs at or above the smallest registered number in obsolete_files_ for a later purge. A compaction registers just before installing its outputs and unregisters after OnCompactionCompleted() returns, so a remote compaction holds nothing back while it waits. A flush registers for its whole duration, which also covers a flush that installs its outputs over several MANIFEST writes. Nothing is registered when no listeners are configured.

This change also documents the behavior in listener.h, as best effort rather than a guarantee: RocksDB actively avoids deleting a file before a callback that reports it returns. The documented exceptions predate this change: the inputs that OnCompactionCompleted() reports (including trivially moved files), and files reported to OnExternalFileIngested(), whose protection ends when the ingestion is committed, before the callback runs.

Registering a lower bound on file numbers, as pending_outputs_ does, rather than the exact output file numbers is a deliberate compromise, because more precision has diminishing returns. With listeners configured, RocksDB therefore still keeps unrelated obsolete SSTs created after a job started while a flush runs or while a compaction's completion callbacks run. That retention lasts as long as a local flush or the callbacks, not as long as a compaction waits. Alternatives considered:

  • Track the exact output file numbers. This alternative keeps only the reported files, but the numbers would have to be passed out of MemTableList::TryInstallMemtableFlushResults() and CompactionJob::Install() at each install site, roughly 2.5 to 3 times the code, only to delete some files a little sooner.
  • Hold a reference on the current Version while listeners run. This alternative is simpler, but the reference is taken after the outputs are installed, so it misses a flush that installs its outputs over several MANIFEST writes if a compaction deletes an earlier output in between.
  • Keep newly installed outputs from being picked by compactions until listeners have been notified. A slow listener would then block compaction of new L0 files.

Consequences

  • rocksdb.min-obsolete-sst-number-to-keep returns the same value as before, but now bounds only unrecognized files found by a directory scan, not known-obsolete SSTs (apart from the brief retention with listeners described above). Its documentation is updated. An application that read the property to decide which obsolete SSTs it could still copy or link out of band would be affected. Like Limit prepared ingestion SST protection to reserved files #15490, this change adds no option to restore the previous behavior.
  • Secondary instances, including remote compaction workers opened by DB::OpenAndCompact(), may find obsolete SSTs deleted sooner than before. They already handle this for files below the cutoff: they read the MANIFEST through ManifestTailer, which builds the most recent Version that has no missing files.

Bonus: CLAUDE.md gets guidance on keeping crash test checks for one feature cheap, so that they do not take time and operations away from finding other failures. The guidance comes from designing the db_stress check described in the test plan.

Reviewed By: jaykorean

Differential Revision: D130987455

@meta-cla meta-cla Bot added the CLA Signed label Nov 17, 2026
@meta-codesync

meta-codesync Bot commented Nov 17, 2026

Copy link
Copy Markdown

@pdillinger has exported this pull request. If you are a Meta employee, you can view the originating Diff in D130987455.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

⚠️ clang-tidy: 1 warning(s) on changed lines

Completed in 890.6s.

Summary by check

Check Count
performance-inefficient-vector-operation 1
Total 1

Details

db/listener_test.cc (1 warning(s))
db/listener_test.cc:2226:5: warning: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation]

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Claude Code Review - OBSOLETE

Superseded by a newer AI review. Expand to see the original review.

✅ Claude Code Review

Auto-triggered after CI passed — reviewing commit 19a04b5


Summary

This is a well-designed change that solves a real production problem (long-running remote compactions preventing deletion of unrelated obsolete SSTs). The core insight is sound: files in VersionSet::obsolete_files_ were part of an installed Version, so they cannot be unfinished outputs. The listener_pending_outputs_ compromise is pragmatic and well-documented. The change correctly preserves all existing safety invariants while narrowing the retention window.

High-severity findings (0):

No high-severity findings.

Full review (click to expand)

Findings

🟡 MEDIUM

M1. Stress test MaybeLongSleep() uses sleep instead of sync point — db_stress_tool/db_stress_listener.h:540
  • Issue: CLAUDE.md explicitly states: "Don't use sleep to wait for certain events to happen. This will cause test to be flaky. Instead, use sync point to synchronize thread progress." The MaybeLongSleep() function uses std::this_thread::sleep_for with random duration up to 100ms.
  • Root cause: The intent is to occasionally hold a completion callback open long enough for a concurrent compaction to make a reported file obsolete. The PR description and CLAUDE.md update argue this is deliberate for the crash test (breadth over determinism), and the unit tests (listener_test.cc) use deterministic sync points instead.
  • Suggested fix: This is an intentional design choice documented in the CLAUDE.md update ("Catching a specific regression only occasionally per run is fine, because the crash test runs constantly"). The MaybeLongSleep is in db_stress (the continuous crash test), not a unit test. The CLAUDE.md guidance about avoiding sleep applies to unit tests that need deterministic behavior. However, the comment could note that this deliberately follows the crash-test philosophy described in CLAUDE.md.
M2. GetObsoleteSstFilesSize behavior change is implicit — db/version_set.cc:8930
  • Issue: GetObsoleteSstFilesSize() reads obsolete_files_ which now retains fewer files (only those above min_listener_pending_output instead of min_pending_output). This means rocksdb.obsolete-sst-files-size will generally report smaller values. This is the intended behavior (the whole point of the PR), but the documentation for kObsoleteSstFilesSize in include/rocksdb/db.h is not updated to explain the change.
  • Root cause: The change in semantics is a natural consequence of the core behavior change.
  • Suggested fix: Consider adding a note to the kObsoleteSstFilesSize documentation that this value will be smaller when long-running jobs are in progress, since known-obsolete SSTs are now deleted promptly.
M3. ReleaseListenerPendingOutput lacks mutex_.AssertHeld() — db/db_impl/db_impl.cc:7020
  • Issue: CaptureListenerPendingOutput calls mutex_.AssertHeld(), but ReleaseListenerPendingOutput does not assert when it actually erases from listener_pending_outputs_. All current callers hold the mutex (BackgroundCallFlush holds it, and the Defer in BackgroundCompaction runs before BackgroundCallCompaction releases it), so the assertion would always pass. Adding it would be consistent and defensive.
  • Root cause: Asymmetry between capture and release methods.
  • Suggested fix: Add mutex_.AssertHeld() inside the if (entry.has_value()) block.

🟢 LOW / NIT

L1. FIFO delete and trivial move paths intentionally omit listener_pending_output — db/db_impl/db_impl_compaction_flush.cc:5620-5813
  • Issue: Verified as correct. FIFO delete creates no outputs. Trivial move outputs are the same files as inputs (still live in the new Version). Neither path needs listener protection.
L2. listener_pending_outputs_ multiset comment — db/db_impl/db_impl.h:4046
  • Issue: The comment "A multiset because compactions register out of number order" is accurate. Compactions can register at the same min_output_file_number as another running compaction (if they both captured the same current_next_file_number), or at different numbers in non-monotonic order across threads.

Cross-Component Analysis

Context Affected? Safe? Notes
WritePreparedTxnDB YES YES Same flush/compaction paths
ReadOnly DB NO N/A No background jobs
SecondaryInstance Consumer YES ManifestTailer handles missing files
CompactionService YES YES Core benefit of the change
CF drop during compaction YES YES CF drop triggers FindObsoleteFiles
DB shutdown YES YES Defer releases; shutdown drains jobs
CompactFiles() YES YES Also purges obsolete files
FIFO compaction YES YES Delete and temp-copy paths handled
Blob files Unchanged YES Intentionally still use min_pending_output

Positive Observations

  • Sound core design: The separation of "unrecognized files from directory scan" vs "known-obsolete files from VersionSet" is clean and well-reasoned.
  • Pragmatic listener compromise: Registration timing (flush: start-to-end; compaction: pre-install to post-callbacks) correctly balances correctness with the problem being solved.
  • Comprehensive testing: Three new tests (remote compaction pinning, flush listener, compaction listener) plus stress test runtime verification.
  • Good use of Defer: Ensures cleanup on all exit paths in both production code and tests.
  • Correct blob file carve-out: Blob files are intentionally excluded because VersionBuilder can report them obsolete without them having been in an installed Version.
  • Clear documentation: Updated kMinObsoleteSstNumberToKeep docs and thorough listener_pending_outputs_ member comments.

ℹ️ About this response

Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.md

Limitations:

  • Claude may miss context from files not in the diff
  • Large PRs may be truncated
  • Always apply human judgment to AI suggestions

Commands:

  • /claude-review [context] — Request a code review
  • /claude-query <question> — Ask about the PR or codebase

Summary:
## Background

RocksDB deletes an SST file once it is obsolete, meaning no Version references it anymore, usually because a compaction replaced it. Files that a running flush or compaction is still writing are also in no Version, but they must not be deleted. To protect them, each flush or compaction records the next file number in `pending_outputs_` when it starts. The obsolete-file purge then skips every SST numbered at or above the smallest recorded number (`min_pending_output`, exposed as `rocksdb.min-obsolete-sst-number-to-keep`). The purge applies this cutoff to every SST: both files found by scanning the DB directories and files that `VersionSet` already knows are obsolete (`obsolete_files_`, filled when the last Version referencing a file is destroyed).

`53af5d877` ("Redesign pending_outputs_", 2014) introduced the cutoff, replacing tracking of each job's exact output file numbers. At first the cutoff was applied only in `PurgeObsoleteFiles()`. That leaked files: a file taken from `obsolete_files_` and then held back was neither deleted nor tracked until the next full directory scan. `863009b5a` ("Fix deleting obsolete files meta#2", 2015) fixed the leak by also applying the cutoff in `VersionSet::GetObsoleteFiles()`, so such files stay in `obsolete_files_` until the cutoff moves past them. A `FIXME` left in `PurgeObsoleteFiles()` asks whether these files should be held back at all. More recently, [meta#15490](meta#15490) stopped prepared external ingestions from holding a `pending_outputs_` entry. They now protect only their reserved file numbers, so a long-lived prepared ingestion no longer holds back unrelated obsolete SSTs.

## The problem

While a long-running job is in progress, obsolete SSTs pile up on disk. Every SST created after the job started and since compacted away is kept until the job finishes, even though none of them can be an unfinished output: each was part of an installed Version, so holding it back protects nothing. Usually the wait is short, but a remote compaction can wait in `CompactionService::Wait()` for hours or days. Under a steady write load, obsolete SSTs can then grow to many times the size of the live data and fill the disk; `rocksdb.obsolete-sst-files-size` shows the growth.

## Previous behavior

- `GetObsoleteFiles()` handed off only obsolete SSTs numbered below `min_pending_output`; the rest stayed in `obsolete_files_`.
- `PurgeObsoleteFiles()` kept every SST candidate numbered at or above `min_pending_output`, from either source.

## New behavior

The purge deletes an SST that `VersionSet` reports as obsolete, whatever jobs are still running, apart from a brief exception when event listeners are configured (below). `GetObsoleteFiles()` hands off all obsolete SSTs, and `PurgeObsoleteFiles()` applies the cutoff only to SST candidates that came from the directory scan. Both parts are needed: changing only `GetObsoleteFiles()` would bring back the 2015 leak.

Unchanged:
- Unfinished outputs are found only by the directory scan, so the cutoff still protects them.
- Inputs of a running compaction stay protected: the compaction holds a reference on its input Version, so they never reach `obsolete_files_`.
- Live files, including trivially moved ones, are still excluded by the live-file set and `only_delete_metadata`.
- Files quarantined after a failed MANIFEST write are still checked before anything else.
- Obsolete blob files still honor the cutoff. `VersionBuilder` can report a blob file obsolete without it having been part of an installed Version, so the argument above does not cover them.

## Keeping event listener outputs available

The cutoff also had a side effect that listeners can observe. A job removes its `pending_outputs_` entry only after its `OnFlushCompleted()` or `OnCompactionCompleted()` callbacks return, so RocksDB did not delete the files those callbacks report while the callbacks ran, even if another compaction made them obsolete in the meantime. `EventListener` did not document this, but a listener that opens, copies, or links a reported file might depend on it. Without the cutoff for known-obsolete files, such a listener could find the file already deleted.

To keep that behavior, this change keeps a narrower form of the cutoff for known-obsolete SSTs, in `DBImpl::listener_pending_outputs_`. While a job might still report its outputs to listeners, its `pending_outputs_` number is also registered there, and `GetObsoleteFiles()` leaves obsolete SSTs at or above the smallest registered number in `obsolete_files_` for a later purge. A compaction registers just before installing its outputs and unregisters after `OnCompactionCompleted()` returns, so a remote compaction holds nothing back while it waits. A flush registers for its whole duration, which also covers a flush that installs its outputs over several MANIFEST writes. Nothing is registered when no listeners are configured.

This change also documents the behavior in `listener.h`, as best effort rather than a guarantee: RocksDB actively avoids deleting a file before a callback that reports it returns. The documented exceptions predate this change: the inputs that `OnCompactionCompleted()` reports (including trivially moved files), and files reported to `OnExternalFileIngested()`, whose protection ends when the ingestion is committed, before the callback runs.

Registering a lower bound on file numbers, as `pending_outputs_` does, rather than the exact output file numbers is a deliberate compromise, because more precision has diminishing returns. With listeners configured, RocksDB therefore still keeps unrelated obsolete SSTs created after a job started while a flush runs or while a compaction's completion callbacks run. That retention lasts as long as a local flush or the callbacks, not as long as a compaction waits. Alternatives considered:
- Track the exact output file numbers. This alternative keeps only the reported files, but the numbers would have to be passed out of `MemTableList::TryInstallMemtableFlushResults()` and `CompactionJob::Install()` at each install site, roughly 2.5 to 3 times the code, only to delete some files a little sooner.
- Hold a reference on the current Version while listeners run. This alternative is simpler, but the reference is taken after the outputs are installed, so it misses a flush that installs its outputs over several MANIFEST writes if a compaction deletes an earlier output in between.
- Keep newly installed outputs from being picked by compactions until listeners have been notified. A slow listener would then block compaction of new L0 files.

## Consequences

- `rocksdb.min-obsolete-sst-number-to-keep` returns the same value as before, but now bounds only unrecognized files found by a directory scan, not known-obsolete SSTs (apart from the brief retention with listeners described above). Its documentation is updated. An application that read the property to decide which obsolete SSTs it could still copy or link out of band would be affected. Like meta#15490, this change adds no option to restore the previous behavior.
- Secondary instances, including remote compaction workers opened by `DB::OpenAndCompact()`, may find obsolete SSTs deleted sooner than before. They already handle this for files below the cutoff: they read the MANIFEST through `ManifestTailer`, which builds the most recent Version that has no missing files.

Bonus: `CLAUDE.md` gets guidance on keeping crash test checks for one feature cheap, so that they do not take time and operations away from finding other failures. The guidance comes from designing the `db_stress` check described in the test plan.

Reviewed By: jaykorean

Differential Revision: D130987455
@github-actions

Copy link
Copy Markdown

✅ Claude Code Review

Auto-triggered after CI passed — reviewing commit a4eec58


Summary

Well-designed change that solves a real problem (obsolete SSTs piling up during long-running remote compactions) with a minimal, focused approach. The core safety argument -- that files in obsolete_files_ were once part of an installed Version and therefore are not unfinished outputs -- is sound and verified by code inspection (~Version() at version_set.cc:1064 is the only insertion path). The listener_pending_outputs_ mechanism is a thoughtful compromise that preserves the existing best-effort file-lifetime guarantee for event listeners without re-introducing the original problem.

High-severity findings (0):

No high-severity findings.

Full review (click to expand)

Findings

🟡 MEDIUM

M1. MaybeLongSleep in db_stress uses sleep_for despite CLAUDE.md guidance — db_stress_tool/db_stress_listener.h
  • Issue: CLAUDE.md says "Don't use sleep to wait for certain events to happen. This will cause test to be flaky. Instead, use sync point to synchronize thread progress." The new MaybeLongSleep() uses std::this_thread::sleep_for with up to 100ms delay in 10% of callbacks. While this is not a unit test (it's the stress test), and the PR description argues that infrequent probing is intentional for stress testing, the sleep approach means the check fires only probabilistically.
  • Root cause: The stress test check needs another compaction to race with the callback. A sleep gives that time window, but it's not deterministic.
  • Mitigation: The PR author explicitly addresses this trade-off in the new CLAUDE.md guidance ("Catching a specific regression only occasionally per run is fine, because the crash test runs constantly"). The unit tests in listener_test.cc provide deterministic coverage. The 100ms max sleep is bounded and reasonable.
  • Suggested action: Acceptable as-is given the stress test philosophy documented in the PR, but consider adding a comment to MaybeLongSleep explaining why sync points aren't suitable here (the goal is to probabilistically create a race window, not to synchronize a specific event).
M2. CompactFilesImpl path does not register listener_pending_output — db/db_impl/db_impl_compaction_flush.cc:1757
  • Issue: CompactFilesImpl creates output files and calls FindObsoleteFiles/PurgeObsoleteFiles (lines 1689, 1703) but does not register listener_pending_output. However, CompactFilesImpl does NOT call NotifyOnCompactionCompleted -- it only populates compaction_job_info for the caller. So this is intentionally not covered. But if CompactFilesImpl runs while another job has a listener_pending_output registered, the global listener_pending_outputs_ set is still consulted by FindObsoleteFiles, which is correct.
  • Root cause: Intentional design -- CompactFilesImpl doesn't use listener callbacks.
  • Suggested action: None needed. This is correctly handled. Including for documentation -- the reader should know this was considered.

🟢 LOW / NIT

L1. FIFO deletion-compaction path lacks CaptureListenerPendingOutput — db/db_impl/db_impl_compaction_flush.cc:5617
  • Issue: The FIFO deletion-compaction path calls NotifyOnCompactionCompleted but does not add CaptureListenerPendingOutput. This is correct because deletion compactions have no output files -- they only delete inputs. The OnCompactionCompleted callback reports input files and an empty output list. Since there are no outputs to protect, no listener_pending_output is needed. The file-lifetime documentation explicitly excludes inputs from the guarantee.
  • Suggested action: None needed.
L2. std::multiset node allocation under DB mutex — db/db_impl/db_impl.cc:7019
  • Issue: CaptureListenerPendingOutput performs a multiset::insert under the DB mutex, which allocates a tree node.
  • Mitigation: The number of concurrent jobs is small (bounded by max_background_jobs). The cost matches the existing pending_outputs_ pattern (a std::list that also heap-allocates nodes under mutex).
  • Suggested action: No change needed.
L3. known_obsolete_sst_set allocation — db/db_impl/db_impl_files.cc:584
  • Issue: The new known_obsolete_sst_set is built from sst_delete_files outside the mutex. The .reserve() call prevents rehashing. For typical workloads this set is small.
  • Suggested action: None needed.

Cross-Component Analysis

Context Affected? Analysis
Secondary instances Yes May find files deleted sooner. Already handle missing files via ManifestTailer. Safe.
ReadOnly DB No No compactions run.
Remote compaction workers Indirect Workers don't use pending_outputs_. Primary benefits from this change.
WritePreparedTxnDB No Same background compaction paths, no special interaction.
External file ingestion No Uses pending_ingestion_outputs_, unaffected.
Checkpoint / Backup No Neither depends on kMinObsoleteSstNumberToKeep.
DB::Close / shutdown Safe listener_pending_outputs_ entries released by Defer. NotifyOnCompactionCompleted skips callbacks during shutdown, Defer still runs.
Error recovery Safe Same FindObsoleteFiles/PurgeObsoleteFiles paths with correct logic.

Assumption Stress Test

Claim: "Every SST in obsolete_files_ was part of an installed Version"

  • Verified: Only insertion path is ~Version() (version_set.cc:1064) when FileMetaData::refs drops to 0. Failed compaction outputs are cleaned up via job context, not obsolete_files_.

Claim: "Inputs of a running compaction are protected by Version reference"

  • Verified: Compaction holds input_version_->Ref(). Input files don't enter obsolete_files_ while compaction runs.

Claim: "Blob files need different treatment"

  • Verified: VersionBuilder can call AddObsoleteBlobFile() directly without the file having been in an installed Version. Correctly preserved.

Defer safety on all BackgroundCompaction return paths:

  • Verified: The Defer release_listener_pending_output is defined early in the function (after the if-else branch determination). All paths -- no compaction picked, deletion, trivial move, forward to bottom, trivial copy, non-trivial, failure -- return through the same scope where the Defer runs. ReleaseListenerPendingOutput is safe with std::nullopt (checks has_value() first).

Positive Observations

  1. Clean separation of concerns: listener_pending_outputs_ is nicely separated from pending_outputs_ with clear documentation.
  2. Defense in depth: Multiple layers of protection preserved (pending_outputs for directory scans, listener_pending for callbacks, Version refs for inputs, live-file set for current files).
  3. Thorough testing: Three complementary strategies (deterministic unit tests, probabilistic stress test, existing tests updated).
  4. Well-documented behavioral change: listener.h, db.h, and release note all clearly communicate the change.
  5. Correct Defer usage: Handles all return paths including early returns where listener_pending_output stays std::nullopt.
  6. Intentional compromise well-justified: Lower-bound approach vs exact tracking is well-reasoned with alternatives enumerated.

ℹ️ About this response

Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.md

Limitations:

  • Claude may miss context from files not in the diff
  • Large PRs may be truncated
  • Always apply human judgment to AI suggestions

Commands:

  • /claude-review [context] — Request a code review
  • /claude-query <question> — Ask about the PR or codebase

@meta-codesync meta-codesync Bot closed this in a813464 Nov 18, 2026
@meta-codesync meta-codesync Bot added the Merged label Nov 18, 2026
@meta-codesync

meta-codesync Bot commented Nov 18, 2026

Copy link
Copy Markdown

This pull request has been merged in a813464.

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.

1 participant