route cluster ttl cleanup through the replicated delete path - #133
Merged
Merged
Conversation
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.
Summary
Cluster-mode companion to the agent TTL fix (#132). The cluster TTL sweep removed expired rows with a raw in-memory
entities.remove:uniquevalue became permanently unclaimableThe sweep now reaps each expired row this node is the data-partition primary for through the same path as a normal delete (
execute_json_delete→db_delete_prepare+db_commit+release_unique_for_deleted_record+ change event + resource-grant clearing), so the delete releases guards, emits a change event, and replicates to the replicas. Non-primary nodes skip; the primary's replicated delete reaches them. It runs under the controller write lock, so the scan and the deletes are atomic with respect to other controller messages (no renewal can interleave). The store's scan+raw-removecleanup_expired_ttlis replaced by a scan-onlyscan_expired_ttl.FK cascade on TTL expiry remains a follow-up (holds are leaf entities) — same deferral as the agent side (
docs/design/hold-reclaim.md).Test plan
cargo test -p mqdb-cluster --all-features(new:ttl_reap_releases_unique_claim_and_removes_row,ttl_reap_leaves_unexpired_row)cargo clippy --all-targets --all-features -- -D warnings