Repository navigation
Fix recycle-bin identity collisions and metadata cleanup ordering (#87) - #97
Merged
Merged
Conversation
Baseline MongoDB 7.0.45/net10 run: 12 expected failures, 10 passes, 0 skips. Product source is unchanged in this commit. Co-authored by Alessandro Giorgetti and Codex (OpenAI).
Use per-attempt stored identities with original bucket and stream metadata, recycle before metadata cleanup, and preserve legacy/public read semantics. Document recovery limits and follow-up #96. Co-authored by Alessandro Giorgetti and Codex (OpenAI).
Capture actual sync/async find filters and sorts over 18,280 mixed commits. Baseline MongoDB 7.0.45/net10.0: 2 expected failures, 0 skips. Recycle lookups examine all 12,240 recycled keys/documents and use blocking SORT; result semantics remain correct. Co-authored by Alessandro Giorgetti and Codex (OpenAI).
Add a nonunique recycle-only compound index without changing existing unique indexes. Verify full sync/async query plans, legacy/new selection, populated-store upgrade, and repeated initialization. Document additive migration, build/write/storage costs, and retained reader compatibility limits. MongoDB 7.0.45: 160 keys and 200 document examinations for 160 mixed-history results instead of 12,240 keys/documents and blocking SORT. Release build including net472 succeeds. Each net8/net9/net10 run: 536 core passes; 278 adapter passes and the unchanged #94 IDHACK assertion failure; zero skips. Co-authored by Alessandro Giorgetti and Codex (OpenAI).
AGiorgetti
marked this pull request as ready for review
October 28, 2026 09:43
7 tasks
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Scope
Addresses #87 using the selected original option 1. Broader lifecycle/recycle-bin redesign is tracked in #96.
Tests first
The first commit, 28ebbd5, contains regression tests only, against unchanged develop 286c0ae:
The following fix adds coverage for mixed legacy/new reads, live-document isolation, retained checkpoints, cleanup, and retry from a deliberately seeded partial-update state.
Indexing follow-up
Tests-first commit 4f5ca52 captures actual sync/async queries over 18,280 records (12,240 recycled, including legacy/new formats, multiple source buckets and deletion attempts). Without the new index, both regression tests fail: every recycle lookup examines 12,240 keys/documents and performs blocking SORT, despite correct results.
The fix adds nonunique
GetFrom_RecycleBin_Indexon{BucketId, OriginalStreamId, StreamRevisionFrom, StreamRevisionTo}, partial onBucketId: ':rb'. Existing unique indexes are unchanged. MongoDB 7.0.45 explain results:Changelog and rollout docs cover index-build/write/storage costs and permissions. No latency/throughput benchmark or lifecycle redesign is claimed.
Final local validation
Exact published head: 8c47929; tree: 9fc05977401ff94a917e3c19a9d6f82473e1538a.
MongoDB 7.0.45 and SDK 10.0.403 were used on dot's cloud computer. net472 was compiled, not executed on Linux. MongoDB 8 coverage is provided by the repository CI service container. Independent source review found no blocker within the bounded scope.
Exact-head GitHub CI
PR CI run 40312108730 and push CI run 40312099115 both completed successfully on head 8c47929. Each passed Ubuntu and Windows builds and the MongoDB 8 Linux test matrix for net8.0, net9.0 and net10.0. No rerun, test suppression or workflow change was needed.
Compatibility and limits
New code reads existing recycled documents without backfill. Their lost original bucket remains unknown. Public BucketId remains :rb; OriginalBucketId is stored provenance only. Original-stream recycle queries combine matching histories across buckets and deletion attempts.
Old binaries/raw queries expose the synthetic stored ID for new records, so upgrade recycle readers before new-format deletion. UpdateMany is not atomic across documents; retries give remaining live commits another token. No durable lifetime grouping, automatic restart recovery, concurrent-delete/recreate fencing, or atomic lifecycle guarantee is claimed. Tests seed partial persisted state rather than killing a process.
Controlled deletion/recovery must exclude concurrent stream writes/recreation and drain background metadata work; readers needing all-or-nothing visibility also need that boundary. Default metadata writes are unacknowledged, so successful return is not a verified cleanup barrier. Existing asynchronous cancellation defects remain separately scoped to #86.
Draft for review. Do not merge or publish packages as part of this task.
Co-authored by Alessandro Giorgetti and Codex (OpenAI).