Repository navigation
Warn when db clean skips only some rows of a batch - #73568
Merged
vincbeck merged 4 commits intoOct 5, 2026
Merged
Conversation
The guarded DELETE added in apache#66350 logged a warning only when ``deleted == 0``, which fires when an entire batch is skipped by the skip_if_referenced guard. The partial case is both the likely one and the harmful one: the archive has already committed a copy of every row the SELECT found, so a row the guard skips is archived and still live, and export-archived will emit a phantom copy of it.
3 of 5 tasks
ramitkataria
approved these changes
Sep 23, 2026
1 task done
vincbeck
approved these changes
Oct 5, 2026
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.
The guarded DELETE added in #66350 logged a warning only when
deleted == 0, which fires when an entire batch is skipped by the skip_if_referenced guard. The partial case is both the likely one and the harmful one: the archive has already committed a copy of every row the SELECT found, so a row the guard skips is archived and still live, and export-archived will emit a phantom copy of it.The count is gated on
skip_if_referencedso tables that cannot skip rows don't pay the extraCOUNT(*)per batch. That also drops a latent wrong message, since an unguarded table reachingdeleted == 0previously claimed its rows were still referenced by another table when nothing referenced them.Raised by @ramitkataria while reviewing #66350.
Blocks #73417 and should be merged first
Was generative AI tooling used to co-author this PR?
Test case generated by: [Claude Sonnet 5] following the guidelines