Repository navigation
Conversation
A cold reader could see the catalog row `Live`, then lose the CPU before `acquireRefTableRuntime` took `ref_queue_mutex`. Removal plus the GC drain retired the life and erased the slot, so the reader inserted a fresh runtime for the dead life. A warm `namespaceLife` then returned it and `putNamespaceFile` acknowledged bytes the dead-life janitor later deletes. - `RefNameSlot` keeps a per-name `retirements` count; `invalidateRemovedCatalogLife` bumps it instead of erasing the slot, also when no runtime is resident. Eviction keeps slots with a non-zero count. - Every cold path captures the count before its first catalog GET; `acquireRefTableRuntime` throws retry-later if it moved. - `namespaceLife` refuses a recovered runtime whose terminal removal is applied. Draft: not built or tested yet. Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`invalidateRemovedCatalogLife` returned without bumping the name's retirement count when a successor life was resident. A delayed cold admission of the predecessor could then insert it once the successor was evicted. The count is now bumped for every retirement, while invalidation and detachment stay limited to the exact predecessor runtime. New tests: - a delayed predecessor retirement with a successor resident advances the count, leaves the successor attached, and the count survives eviction; - `namespaceLife` refuses a recovered terminal runtime whose removal-admission flag is clear, on the cold call and on the warm one; - the cold `namespaceLife` window between its catalog read and its insertion. Draft: not built or tested yet. Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Draft: not built or tested yet. Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
Stateless tests (amd_binary, cas s3 storage, parallel) and Stateless tests (amd_debug, parallel): |
This branch has not been deployed
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.
A cold admission of a namespace runtime could publish a life that was retired while it waited, and a re-created table then wrote acknowledged files into that dead life. The cold path reads the catalog row (
Live, life L), then takesref_queue_mutexto install the runtime; no lock is held in between. IfDROP TABLEand the GC drain retire L in that window,invalidateRemovedCatalogLifeerases the name's slot, and the delayed insertion installs a runtime for L into the empty slot. A table re-created with the same UUID then gets L from the warmnamespaceLife,putNamespaceFileacknowledges its files, and the dead-life janitor deletes them.Changes
RefNameSlotkeeps a retirement count.invalidateRemovedCatalogLifebumps it underref_queue_mutexand clears the slot's runtime instead of erasing the slot, whatever runtime is resident, including a successor's. A slot is evicted only while its count is zero.acquireReadableRefTableRuntime,namespaceLife,namespaceStillLogicallyPresent,dropNamespaceImpl,acquireMutableRefTableRuntime.acquireRefTableRuntimerefuses with a retryable error if the count moved; the retry re-reads the catalog.namespaceLiferefuses a runtime whose recovered state is terminal.Risks / notes
Testing
DROPand two GC rounds (a test backend runs them during the second catalog GET); a retirement recorded while a successor is resident survives its eviction;namespaceLiferefuses a recovered terminal life.CAS*unit tests green in release.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
CAS: a table dropped and re-created with the same UUID could have acknowledged table files deleted by GC, when a concurrent read admitted the dropped table's namespace while the drop completed.
Documentation entry for user-facing changes
CI/CD Options
Exclude tests:
Regression jobs to run: