Repository navigation
CAS: replace blob markers with deletion intents (format generation 4) - #2917
Merged
filimonov merged 47 commits intoNov 23, 2026
Merged
Conversation
`manifestDeletionPremise` rendered the sealed cursor with `renderRefTxnId`, which throws `LOGICAL_ERROR` on the zero cursor of a live table whose ref log is empty. The GC round over such a table failed every time. The retain message now says `none`; the retain decision is unchanged. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`canonicalIdentity` spells one incarnation one way (quoted and bare ETags compare equal) and rejects tokens that cannot name a blob body: weak, empty, wildcard, list, over 128 bytes. Nothing uses it yet. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`CountingBackend` records an ordered, thread-safe journal of requests. `EtagFaithfulPublicationBackend` moves to a shared header. `DialectOverrideBackend`, `HeadHookBackend`, `seedOlderPoolForTest` and `markCutComplete` are new. Test-only. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Pool meta carries `token_dialect`, `gc/state` header 4 carries `intent_sweep_cursor`, condemned rows carry `standing`. A deletion intent is one constant record keyed by the blob and the canonical identity of its body; `Layout` builds and parses the key, `createBlobIntent` confirms a create. `G_BUILD` stays 3 and no server path writes any of it, so a reader at the default ceiling still refuses these objects. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`StreamingBlobPublication` carries the expected `BlobRef`. Every streaming `publish` checks the size and digest of exactly the bytes it forwards and refuses to complete the object on a mismatch: `CORRUPTED_DATA`, counted by `CASBlobPublishDigestMismatch`, not retried. A wrong size is reported before a wrong digest. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
The capability probe refuses a store whose `HEAD` token names no incarnation, and reports a refused write (`READONLY`, `EACCES`, `EPERM`, `EROFS`, S3 denials) at once instead of retrying to the deadline. `runIntentPrefixProbe` checks the `blob-intents/` rights under a scratch sub-prefix and names the missing right; nothing calls it yet. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`decideIntentStep` maps one GC row, the cut of the round and its decision `HEAD` to one step; `decisionHeadNeed` says which `HEAD` a row needs. The test walks every reachable cell of the rule table and checks that every unreachable one throws. No GC round calls the rules yet. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
- `G_BUILD` is 4; new pools start at floor 4 with the store token dialect. - Every open refuses an older pool or another dialect; a writable open proves the `blob-intents/` rights. - The writer adopts a present body only when its token has no intent. - GC creates intents in a budget; later rounds delete body, then intent. - Orphan intent sweep; marker code removed; `cas-fsck` checks intents. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`migratePool` converts a stopped pool from blob markers to deletion intents in steps that can each be repeated, so a rerun completes a run that stopped anywhere. `clickhouse-disks` defers the pool open of the disk for this command only and refuses it beside other commands. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Protocol, garbage collection, migration, fsck, monitoring and bucket-rights pages for the intent protocol; renamed counters and `cas_log`/`cas_gc_log` columns. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
20 of 30 tasks
A blob referenced again while its GC row was `pending` or `standing` kept `I(B,t)` after a writer had replaced the body: an orphan no round removed. In an unsuppressed round the fold sends a `HEAD` for such a row and adds `I(B,t)` to the round's intent deletes when the body shows another canonical identity; the same token, an absent or short body keep it. The `HEAD`s run on the GC I/O pool within `gc_io_concurrency`; counted in `CASGCIntentDeletedOnSpare`. The test fakes' once-hooks take a mutex. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Tools that read the row by name lost `entries_graduated`, `entries_redeleted` and `entries_redelete_failed` with the counter rename. The row keeps them after `pending_retired`, filled with the values of their renamed counterparts. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
GC could delete a body a committed part names. A no-bytes copy into another namespace between two frontiers of one round, into a namespace born after the catalog read, or of a republished body escapes the other namespace's cut, so the count reaches zero. Only a zero after a round that folded no record of the blob proves no part names it: otherwise `decideIntentStep` carries the `pending` row. Tests reproduce each case in both walk orders, with controls that keep the body. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
A GC leader paused after its intake could read a ref log a newer leader had cleaned as the end of the stream, and delete bodies live parts name. When the adopted parent holds a `pending` or `standing` row, one `HEAD` of `gc/state` before the reduce must show the leased version. Otherwise the round sets `suppress_destructive` with reason `parent_unconfirmed` and deletes no body and no intent. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
A rebuild derives edges from owner state. A live precommit with an unreadable manifest left its blobs uncounted, and a later zero transition deleted a body the promoted part names; the rebuild refuses such a pool. A refused rebuild gives back its lease claim with one conditional write: a rebuild never steals and each run takes a fresh identity, so a kept claim made every retry refuse as a competing leader. A lost give-back is logged. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
A copy without bytes could promote a part whose source was dropped and whose body GC deleted: the new part named a missing body. After `precommitAdd`, a hardlink confirms each distinct source with `Pool::confirmExactRef` and `republishRef` the source binding it read; an unconfirmed source takes the build back with `NO_REPLICA_HAS_PART`. In-process callers wait for the state lock; the relink sender keeps `TryLock`. Also carries smaller fixes to the parent check and the rebuild refusal, and a test-only fix of a flaky namespace-removal test bound. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
An untouched zero proves no reference only if a round walks every live namespace from its first record. Tests pin that for a namespace first seen in the round, one the stream listing omits and one re-created under an old name; that a `Creating` life refuses a precommit; and that the catalog read follows the lease acquisition. Docs explain the untouched zero, the `parent_unconfirmed` check and the copy-source confirmation. No product change. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`Gc::setRoundPointHookForTest` runs a callback after the catalog read, after each namespace walk, after the intake and before the `gc/state` commit. `CASInterleave` copies a part by `createHardLink`, `republishRef` and relink at each point, for each row state, hop shape and walk order, and checks that no part names a missing body. Adds deposed-leader, late-delete and lost-validation tests. Also pins that a life with a published snapshot is walked from its first record; corrects GC docs. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
- A store whose `gc/state` token has no canonical identity (a weak ETag) suppressed every body delete: the parent check compares exact tokens. - A deposed leader whose parent runs a newer leader pruned failed with `CORRUPTED_DATA`: when `gc/state` moved, the round ends with `ABORTED`. - A pending row over an undecodable body took the only `cas_gc_round_redelete_budget` slot every round, starving the rest. - A rebuild over an unreadable live precommit reports a soft refusal. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Integration suite `test_cas_cross_table_copy_gc`: `MOVE`, `ATTACH` and `REPLACE PARTITION`, `CLONE AS`, a namespace-changing `RENAME` and a relink fetch, each followed by a drop of the source, with GC rounds in a loop; plus `SYSTEM CAS GC REBUILD FORCE` on a pool with GC history. It does not force an interleaving inside one round: unit tests cover that. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`ConfirmLockMode::Wait` waited for a table's `state_mutex` holding `ref_queue_mutex`, so appends of every table queued behind one copy: it waits holding no ledger lock, until the request window passes. A store error during the confirm became a retryable refusal, and `republishRef` then completed by dropping the source: the error propagates. Staged entries clear and re-key in linear time; the copy matrix covers relay pass 2 and several GC shards. Also tightens the integration copy tests. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
- `cas_gc_round_redelete_budget` bounds pending-row `HEAD`s; the next round resumes after the last row that took a slot. - A `cas_gc_round_graduation_budget` cap lost on upgrade applies to `cas_gc_round_intent_create_budget` unless that is set. - A deposed leader's seal read and drain end with `ABORTED`. - `cas-migrate-pool` checks the seal, `gc_shards`, the intent prefix and token form, also with `skip_access_check`. `cas-fsck` reports pending rows gone before the scan in `pending_intent_absent`. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
A cross-part `moveFile` took the only pending record from a hardlink left in the source part, so a committed source could promote a body nobody uploaded. A blob entry with no record and no copy source throws `LOGICAL_ERROR`. A copy confirm holds the source table between its wait and next pass, and its refusal says whether the source changed. Also: the redelete position survives a suppressed round, and `cas-migrate-pool` applies the GC merge's row rules to every inherited run before the floor. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Shared test helpers (`messageOf`, `MissedWriterPool`, `ReadAheadWindowProbe`, the publication fixture) replace per-suite copies. Product code gains `CountWithExample`, `copyVerifiedPayloadAndFinalize`, `forEachChangedSlot`, `precommitAndUpload` and `ShardFoldOptions`, defines the `SYSTEM CAS FSCK` columns in one list and drops two unused parameter modes. Log lines, column names and orders, and request order are kept. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
The fold and `cas-migrate-pool` M3 read a parent seal's runs through `AdoptedRunReader`. It refuses a row of another GC shard, rows out of `(BlobRef, source_id)` order and a row stamped after the parent round; M3 drains every run before any intent or floor change. The five GC refusals advised `cas-gc-rebuild`, which refuses any pool whose GC held the lease: they say GC stops reclaiming and stored data is not affected. `cas-fsck` checks its deadline before each present pending body request. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`republishRef` could remove a committed destination when its source was repointed meanwhile. Once the destination commits the source's content, it removes only the exact source; a repointed source throws `CAS_OWNERSHIP_CONFLICT` and keeps both bindings. The copy confirm runs on the table runtime the resolution pinned, under one request deadline, and a borrow follows the transaction's own rename of its source. A part emptied of its staged files is a `LOGICAL_ERROR`, not a retry loop. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`cas-migrate-pool` queued a body for its deletion intent only when the body's own key was in the listing. A body whose `Clean` legacy marker was listed while its key was not got no intent, and the run still raised the pool floor. Every marker the tool reads now queues the blob it names; the dry run counts the same candidates. Adds tests for a refusal on a later listing page and for the dry-run preview of a `standing` row; corrects the migration and fsck docs. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`test_fetch_paused_before_confirm_then_source_dropped` failed with "the fetched part is committed but does not read back in full". After a refused fetch the part-check thread replaces the lost part with an empty part of the same name; the test took it for a committed fetch. The refusal branch now also asserts from `system.part_log` that no `DownloadPart` with rows was recorded. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
A copy that reads no bytes (`ATTACH PARTITION FROM`, a mutation that hardlinks) confirms its source and reads the mount slot for that. The read made one attempt, so one transient store timeout failed the statement: `Code: 499 ... Poco::Exception ... Timeout (S3_ERROR)`. The in-process confirm now uses the standard bounded retry policy, capped at its deadline; a spent budget still propagates. The confirm a peer asks for keeps one attempt: its failure is a refusal the peer's replication queue retries. A test pins that single attempt. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
One pass of the source confirmation answers `Unknown` on states a healthy server passes through: above all when this server's own mount lease renewal lands between the slot read and the ownership check. The in-process confirm had no second ask, so a mutation or a copy failed with `NO_REPLICA_HAS_PART` "could not be confirmed". `Pool::confirmPinnedRef` now repeats the whole pass (ownership capture, ledger snapshot, slot read) until `Yes`, `No`, or its existing deadline. `No` is final. A refusal that cannot clear (a retired pin, a closed or faulted lane) stops at once. A pool teardown ends the wait with `ABORTED`, also inside the slot read's retries. Each `Yes` is the same full proof as before; only the number of passes changes. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`test_a_first_attempt_timeout_is_reissued_as_attempt_two` delayed the conditional `PUT` by 3000 ms, equal to the client's first-attempt receive timeout. When the delayed `PUT` landed first, the client settled by reading back and no reissue was captured. The delay is now 6000 ms. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Each blob upload held a fixed write buffer, so a query fanning out many small uploads exceeded its memory limit: `03770_min_columns_to_activate_adaptive_write_buffer` failed with "Query memory limit exceeded: would use 50.24 MiB". The buffer is sized to the envelope and payload plus one byte. The extra byte matters: a buffer that is exactly full doubles in `WriteBufferFromS3` before the upload (a 900 KiB body peaked at 2.77 MB; now 0.93 MB). Origin: commit ac144e848aa5 of branch work/antalya-26.8/cas-upload-buffers, adapted to this branch (`emuPublishBlobAtomically` reads the payload size from the publication) and extended with the one-byte margin and a test that measures the peak allocation. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
The CAS-on-S3 MSan lanes ran 3 shards of about 4700 tests on a 32 GiB runner. The test runner retires a worker whenever server RSS passes 80 % of its limit, so each shard dropped from 6 workers to 1 within 40 minutes and hit the job time limit. TSan shards of 7000 tests did not fit either. MSan: 6 shards on `AMD_LARGE` with a 4 h timeout; TSan: 4 shards on `AMD_LARGE`: the runner and shard count of the ordinary lane of the same sanitizer. ASan already matched. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
`03572_export_merge_tree_part_limits_and_table_functions` expects 5 exported files. The export sink rotates files only between chunks, so the count depends on how the part is read; randomized `index_granularity` settings gave 4. The test table now pins them. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
…date of it is uncommitted A mutation could pick a part while a lightweight `UPDATE` with a lower block number had not written its patch part yet; the mutated part then skipped the patch and the acknowledged update was lost. This branch needs it as the base of ClickHouse#124167 (lost lightweight `DELETE` in CI). Upstream: ClickHouse#119155 Upstream merge commit: 72006b7 Commits of the upstream pull request: - 8a53df6 Merge remote-tracking branch 'origin/master' into mergetree-mutation-pending-patch-116686 - 7638e85 Tag `05227_mutation_waits_for_lightweight_update` as `no-fasttest` - d9f77ec Merge remote-tracking branch 'origin/master' into mergetree-mutation-pending-patch-116686 - 4398d33 Wake up the postponed mutation and make the test deterministic - cf21123 Merge remote-tracking branch 'origin/master' into mergetree-mutation-pending-patch-116686 - ea880f9 Merge branch 'master' into mergetree-mutation-pending-patch-116686 - 8db4dc2 Leave a part alone while a lightweight update of it is uncommitted Adaptation for antalya-26.8: - None: applied as is. (cherry picked from commit 72006b7) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ed and reported done in MergeTree A mutation takes its block number before it is registered. A part mutated in that window moved past the unregistered version, so its commands were never applied while the mutation reported done. Seen here as an acknowledged lightweight `DELETE` lost in CI (`cas_lightweight_delete`): mutation 16 registered before mutation 15. Upstream: ClickHouse#124167 Upstream merge commit: 9355332 Commits of the upstream pull request: - f112590 Do not skip a mutation that has its block number but is not registered yet Adaptation for antalya-26.8: - `src/Storages/StorageMergeTree.cpp`, `StorageMergeTree::getMutationVersionForMergedPart`: hunk dropped. The function and `isMaterializedByMerge` do not exist on this branch: a merge here never records a mutation version above its source parts. - `05331_mutation_not_skipped_before_registration`: kept as is. Both cases, including "a merge materializes the DROP COLUMN first", fail without this change and pass with it. (cherry picked from commit 9355332) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ion per idle stream above the soft limit A reader that keeps many S3 streams open held one pooled connection per stream, idle between fills. Above `disk_connections_soft_limit` each fill becomes its own ranged request whose connection returns to the pool at once. Seen here on the CAS-S3 lanes: a horizontal merge of `system.metric_log` (2425 columns) holds thousands of sessions, and the warning `Too many active sessions in group Disk` fails random tests. Upstream: ClickHouse#119730 Upstream merge commit: 6f80dda Commits of the upstream pull request: - 09f900d Make `CountedSession::total` atomic in `gtest_readbuffer_s3` - 8221d48 Merge branch 'master' into fix-s3-read-buffers-hoarding-connections - c69cee4 Release the failed request in `readBigAt` before the retry back-off - 02a5405 Merge remote-tracking branch 'origin/master' into fix-s3-read-buffers-hoarding-connections - 4cd8d1f Stop S3 disk reads from holding a connection per idle stream above the soft limit Adaptation for antalya-26.8: - None: applied as is. `ReadBufferFromS3::initialize` merged without conflict around this branch's response-identity check: `pending_response_etag` is still recorded after `sendRequest`, so every cut request is checked against `last_delivering_response_etag`. (cherry picked from commit 6f80dda) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
… event and stop 04812 from counting cut requests Counts the S3 disk reads cut to one buffer fill by ClickHouse#119730, so the cut is visible in `system.events` and `query_log`. `04812_prewhere_fragmented_ranges_s3_read_requests` asserts a request count and fails when the server is above the soft limit; it now excludes cut requests. Upstream: ClickHouse#124701 Upstream merge commit: 35cab67 Commits of the upstream pull request: - 743e625 Add ReadBufferFromS3RequestsCut profile event and stop 04812 from counting cut requests Adaptation for antalya-26.8: - None: applied as is. (cherry picked from commit 35cab67) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
Conflicts: `.github/workflows/master.yml` and `pull_request.yml` (both sides changed the generated job lists). Resolved by regenerating them with `python3 -m ci.praktika yaml` from the merged `ci/defs`. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
5 of 31 tasks
Member
Author
|
CI triage at
|
9 of 30 tasks
k-morozov
approved these changes
Nov 23, 2026
k-morozov
added a commit
that referenced
this pull request
Nov 23, 2026
Keep the generation 4 blob intent sweep on its own cursor while the manifest sweep waits for its interval. Commit both cursors and the manifest completion timestamp in the same conditional update of `gc/state`. Exercise intent progress during the manifest cooldown and retain multi-round coverage for an empty ref stream. Renumber the stateless scheduling test to 05814 because the release branch uses 05486 for blob intent requests. Related: #2917 Related: #2800 Co-authored-by: Codex (gpt-6.2-astra) <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
k-morozov
added a commit
that referenced
this pull request
Nov 23, 2026
Use the ETag from the fold's decision to group conditional blob deletes by shard. A replacement written after the fold survives the delete. Keep deletion intent cleanup on the separate write-once path introduced in #2917. Co-authored-by: Codex (GPT-6) <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
10 of 30 tasks
Collaborator
|
After this PR was merged, the integration test |
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.
CAS (content-addressed storage) drops the per-blob
.metamarker. GC records its decision to delete a blob body in a deletion intent: an immutable object underblob-intents/, keyed by the blob and the exact incarnation of its body. A firstINSERTof new data needs half thePUTrequests, and GC leaves no marker behind. The change also fixes a data loss in GC that the marker protocol has too (see "Data loss fixed").Draft. Commits 1 to 10 are the protocol; commit 8 is the switch. Commits 11 to 33 are fixes and follow-ups, one theme each; every one of them is a tree that was built and tested as a whole. The last commit merges
antalya-26.8(one conflict, in a docs file); that merged tree was not built locally.Data loss fixed
ATTACH PARTITION FROM,REPLACE PARTITION,MOVE PARTITION TO TABLE, a mutation that hardlinks unchanged columns,RENAME TABLEin anOrdinarydatabase), followed by a drop of the source, could lose blob bodies. A GC round counts references table by table. If it read the destination table before the copy and the source table after the drop, it saw zero references for a blob that a committed part names, and deleted the body.antalya-26.6has it with the marker protocol: there it needs two such hand-overs in a row (shown by a model, not reproduced on that code). It is not fixed onantalya-26.6; upgrade to get the fix.gc/statebefore anything destructive and stops if it is no longer the leader's state (a paused leader that woke up after another leader cleaned the logs could also delete a live body). Copies confirm that their source is still current after the destination is recorded. The GC baseline rebuild refuses when it cannot count the references of an unfinished write.Changes: the protocol (commits 1 to 10)
HEADof the body. Absent: upload. Present:GETof the intent for that incarnation; absent means reuse the body, present means upload a fresh incarnation. A writer never writes or removes an intent.candidate,pending,standing, decided by the pure functiondecideIntentStep. One round creates and confirms the intent, a later round deletes the body with a conditional delete, a later round removes the intent. A row is dropped when a reference appears. A round with an incomplete reference cut deletes nothing.gc_io_concurrency).gc_round_intent_create_budget(default 0, unbounded) caps them per round.clickhouse-disks cas-migrate-poolconverts an older pool once, offline, including pools written by the 26.6 line.cas-fsckknows the intent classes, reports apendingrow without its intent, and treats legacy markers as debris (--fix legacy-markers).blob-intents/and reports the missing one.LOGICAL_ERRORfromrenderRefTxnIdon a zero cursor). The same code is onantalya-26.6.Changes: fixes and follow-ups (commits 11 to 33)
gc/state(reasonparent_unconfirmedinsystem.content_addressed_gc_log); a deposed leader's round ends asABORTED, notCORRUPTED_DATA; the delete budget rotates, so one stuck row cannot starve the rest; one reader checks every inherited GC run (shard, order, round, summary) for the GC, the migration,cas-fsckand the dry run.createHardLinkand the part rename confirm their source after the destination is recorded and before it is committed, on a pinned table with one deadline; an unconfirmed source fails the statement withNO_REPLICA_HAS_PARTand a message that says to run it again; a rename never deletes a committed destination.cas-migrate-poolvalidates the GC state it adopts and probesblob-intents/rights before its first irreversible step;cas-fsckandcas-gc-dryrunre-read a GC snapshot that moved under them;cas-fsck --concurrency; a deadline ends a scan as a timeout, not as findings.==: two named comparisons, one for a blob's identity and one for a control object's version.CASInterleave); without the GC rule 30 cells lose a body, without the source confirmation 56 do. An integration suite runs the SQL copies under running GC rounds.One
INSERT ... SELECTinto a 109-column table: 340Wideparts, 60,008 blobs. Local RustFS, measured on the tree of commit 35. After: median of 3. Before (0aa837e942e): one run on the same day.PUTATTACH PARTITION ALL FROM, 340 parts, sGETper part)A new blob costs one
PUTless, so a first insert is about 37 % faster. Reuse costs the same. An earlier series measured 503.1 s and 16 to 44 leaked markers on the base; the rerun gave 436.7 s and no leaked marker, so those two figures are not claimed.Also in this pull request (commits 35 to 46)
ATTACH PARTITION FROMwithS3_ERROR. One confirmation pass answeredUnknownwhen this server's own lease renewal landed during the slot read: a mutation failed withNO_REPLICA_HAS_PART. The in-process confirmation now retries the read and repeats the whole pass until its deadline; a refusal that cannot clear stops at once; pool teardown ends the wait.ac144e848aa5ofwork/antalya-26.8/cas-upload-buffers), with one byte of margin so the S3 buffer does not double before the upload. Fixes03770_min_columns_to_activate_adaptive_write_buffer.DELETEorUPDATEwas lost when two mutations registered out of order (seen in thecas_lightweight_deleteregression job).ReadBufferFromS3RequestsCutprofile event and stop 04812 from counting cut requests ClickHouse/ClickHouse#124701: a merge of a wide table held one S3 connection per column per source part ("Too many active sessions in group Disk").test_cas_cross_table_copy_gc,test_cas_gcs,03572_export_merge_tree_part_limits_and_table_functions.Risks / notes
cas-migrate-pool, then start this build. Steps:docs/en/antalya/cas/operations/migration.md.PUT,GET,LISTandDELETEunderblob-intents/:docs/en/antalya/cas/bucket-requirements.md.SYSTEM CAS GC REBUILDandclickhouse-disks cas-gc-rebuildrefuse withanother GC leader holds the leaseon such a pool; this is older than the change and is shown by a test here. GC then stops reclaiming on that pool; stored data is not affected. The fix is a follow-up.SYSTEM CAS GC RUNandsystem.content_addressed_gc_logkeep the old column names next to the new ones (entries_intent_confirmed,entries_bodies_deleted,entries_body_delete_failed). The countersCASGCRetiredGraduated,CASGCRetiredRedeleted,CASGCRetiredRedeleteFailedkeep counting next toCASGCRetiredIntentConfirmed,CASGCRetiredBodyDeleted,CASGCRetiredBodyDeleteFailed. Removed without a replacement: thephase_metricskeysgraduated,redeleted,redelete_pending,graduation_due,jobs_completed,jobs_completed_on_entry. Settings:cas_gc_round_graduation_budgetis obsolete and its value carries over tocas_gc_round_intent_create_budget;cas_gc_meta_pool_sizeis obsolete and ignored.CA/Gc/CasIntentRules.cppand its exhaustive test; the adopted-run reader inCA/Gc/CasBlobInDegree.*;republishRefinCA/Parts/PartFolderAccess.cpp;CA/Tools/CasMigratePool.cpp.KILL QUERYdoes not interrupt that wait.Diskconnection soft limit an S3 read is cut into one request per buffer fill; on a disk that rewrites keys in place (plain_rewritable) the fills of one read are not pinned to one object version. CAS blobs are content-addressed and are not affected.Testing
CAS*4,704 passed (release), 4,707 (ASan, no sanitizer report), on the tree of the working branch before the base merge.test_cas_gc_s3,test_cas_blob_intent_migration(a pool made by the 26.6.4 image),test_cas_shared_pool,test_cas_cross_table_copy_gc(new). The othertest_cas_*suites and the 61 CAS stateless tests ran on earlier trees of the same work.05331fails before and passes after.Not verified yet
03770,03990and03572were not run locally on CAS over S3. No rounds suppressed by the parent check were observed in any soak: that path is covered by unit tests only.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
CAS (content-addressed storage) no longer writes a
.metamarker next to every blob: the firstINSERTof new data sends half as manyPUTrequests, and garbage collection leaves nothing behind. Upgrade with care: the pool format changes to generation 4. Stop all servers of a pool, runclickhouse-disks cas-migrate-poolonce, then start the new version; older versions can no longer open the pool. The disk needs rights to create, read, list and delete objects underblob-intents/.Documentation entry for user-facing changes
CI/CD Options
Exclude tests:
Regression jobs to run: