fix: stop a prune cycle cleanly and count what it actually pruned - #360
Open
mennatnaga wants to merge 7 commits into
Open
fix: stop a prune cycle cleanly and count what it actually pruned#360mennatnaga wants to merge 7 commits into
mennatnaga wants to merge 7 commits into
Conversation
mennatnaga
force-pushed
the
menna/pruner-bounded-stop
branch
from
August 12, 2026 14:14
1422011 to
5d87e5f
Compare
mennatnaga
force-pushed
the
menna/host-stats
branch
from
August 13, 2026 14:04
14d3900 to
e743c08
Compare
mennatnaga
force-pushed
the
menna/pruner-bounded-stop
branch
2 times, most recently
from
August 14, 2026 22:54
dd39810 to
10d0928
Compare
mennatnaga
changed the base branch from
menna/host-stats
to
menna/signal-shutdown
August 14, 2026 22:54
mennatnaga
marked this pull request as ready for review
August 14, 2026 23:35
dvncan
previously approved these changes
Aug 18, 2026
tzdybal
force-pushed
the
menna/signal-shutdown
branch
from
September 1, 2026 10:03
e91f062 to
a18094b
Compare
mennatnaga
force-pushed
the
menna/pruner-bounded-stop
branch
from
September 1, 2026 11:59
b2c9102 to
f08bf24
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
mennatnaga
force-pushed
the
menna/pruner-bounded-stop
branch
from
September 2, 2026 01:59
f08bf24 to
e7d050e
Compare
* chore: log host runtime and prune queue stats * chore: use testify and tighten the stats test setup * chore: read heap and GC stats without stopping the world
mennatnaga
force-pushed
the
menna/pruner-bounded-stop
branch
from
September 2, 2026 02:26
e7d050e to
66a1b8b
Compare
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.
Related #365
Stacked on #357.
DrainDocsempties every collection up front, so a cycle that ends before reaching them all has to put the rest back. Nothing else re-adds a document once it has replicated, so anything left behind is never pruned. A stop now re-queues every collection still drained.The purge is handed to DefraDB in batches. DefraDB does not check the context inside a call, so a batch boundary is the only place a stop can be noticed.
PurgeByDocIDsreports only an error, and a document that was already gone purges silently, so the number it yields is documents submitted rather than deleted. The counter, its JSON tag and the log lines now say so.Blocks are counted only when their own purge succeeded. A re-queued block collection is drained and counted again on a later cycle, so counting it on the failed cycle let the total exceed the blocks that were ever pruned.