Repository navigation
Conversation
|
I think we will need to add the feature test on disk start (add to other checks, but set the flag / show info instead of stop) |
Resolve the CAS GC conflicts while preserving the antalya-26.8 marker-round semantics. Related: #2534
Bring the pull request up to the current release-branch tip after retargeting. Related: #2534
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Replace the parallel `io_results`, `io_errors` and `delete_submitted` vectors in `Gc::redeleteBlobs` with one `RedeleteBlobState` per entry. The observation result (`live_token`) is now separate from the delete result (`del`), so `performRedeleteIo` becomes `observeRetiredBlob`. Rename `applyRedeleteOutcome` to `recordRedeleteSuccess` and `reportRedeleteFailure` to `recordRedeleteFailure`: the delete has already run when they are called, and `Outcome` already names the persisted `GcOutcomes` log. Rename the test hook and test names to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Move the selection of token-matched entries and their split into conditional delete chunks out of `Gc::redeleteBlobs` into `Gc::prepareConditionalDeleteChunks`. The second wave now only submits the prepared chunks, so `matched`, `delete_begin` and `delete_indices` are gone. The function and its value types are public so that the new `CASGCConditionalDeleteChunks` tests can call it without a pool or a backend request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Move the conditional delete chunk size calculation out of `Gc::redeleteBlobs` into a method next to `Gc::bulkDeleteChunkKeys`. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Add `Gc::runRedeleteIoJobs` and use it for both the observation wave and the conditional delete wave in `Gc::redeleteBlobs`. It runs jobs inline when `concurrency <= 1` or there is at most one job, and on the GC I/O pool otherwise. It returns per-job errors and the enqueue refusal. `jobs_scheduled` still counts only observation jobs submitted to the pool. The delete wave now also runs inline at `concurrency <= 1`, and both waves use one injected enqueue refusal message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Split the tail of `Gc::redeleteBlobs`: - `Gc::recordRedeleteResults` records failures and successes and returns the error with the lowest entry index; - `Gc::scheduleBlobMetaDeletes` schedules `.meta` deletion for `Removed` and `Gone` blobs; - `Gc::redeleteBlobs` rethrows the error after both steps. `Gc::recordRedeleteSuccess` no longer schedules `.meta` deletion, so a later batch `.meta` delete changes only `Gc::scheduleBlobMetaDeletes`. If recording throws, no `.meta` deletion is scheduled for the round; the next round records the blobs as `Absent` and schedules it then. Rename `RedeleteBlobState::del` to `removal` (it can come from the observation wave, not only from a delete) and the wave results to `observe_jobs` and `delete_jobs`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
897bafe to
8b0a9b8
Compare
A backend limit can shrink after GC chooses its chunk size. Reject a chunk above the current limit before sending it and report both sizes. Cover the backend limit and the absolute cap of 1000 keys. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
A missing, unexpected or repeated key in a `DeleteObjects` response leaves the outcome of the batch ambiguous. Report `CORRUPTED_DATA` so CAS propagates the failure. Exercise each malformed reply with the standard retry policy and require exactly one delete request. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Move the object vector from the backend into `ConditionalDeleteBatch` so it owns the keys throughout response parsing. Borrow the bucket name as a string view until the request or log entry needs its own copy. Name the backend attempt `removeManyIfTokensMatch` to distinguish it from the retrying `CasOperation::removeManyByConditional`. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Explain which keys GC retries after a lost response and why it stops on a response with missing, duplicate or unexpected keys. Describe how lowering the S3 disk limit can reject a chunk before it is sent. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Identify the probe prefix and the first unexpected per-key result or readback discrepancy. Report unsupported operations and skipped checks so operators can see why a mount uses single-key deletes. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
After workers finish, identify the failed chunk by round, shard, index, key count and first key. Count every pending row in the failed job and each enqueue refusal once so existing failure counters retain their units. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Describe how to find the probe decision and inspect a failed delete chunk. Align the operator reference with the delete marker exception, the failure counter units and the scope of `gc_bulk_delete_chunk_keys`. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
When `objects_chunk_size_to_delete` is 1, keep the mandatory single-key checks and skip the conditional batch probe before it writes any scratch keys. Log the configured limit. Raising it later allows batching once a subsequent mount verifies support. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Read the configured storage limit when opening the disk and pass the resulting flag to the capability probe for both writable mounts and pool migrations. This keeps single-key checks active without exposing the storage setting through CAS operations and backend decorators. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
After a partial delete, identify the first key still awaiting a result and the number of other pending keys in retry diagnostics. Name `objects_chunk_size_to_delete` when a chunk exceeds its limit, and explain that S3 can create delete markers with versioning enabled or suspended. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
A GC chunk can require multiple conditional requests after a partial failure, and the SDK can retry within a single call. Increment `DiskS3ConditionalDeleteObjects` each time the SDK signs a multi-key delete with per-key ETags. This also counts capability probes and leaves ordinary batch and single-key deletes out of the total. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
After a partial batch delete, a bodyless 404 on the remaining key leaves its outcome unknown. Verify that CAS retries only that key with its original `ETag` and reports `Mismatch` when S3 then rejects the precondition. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Run conditional deletes under the per-request retry window and honor a background stop before the first delete. Check the submitting thread group before a GC worker sends its chunk so a failed attachment leaves every key in that chunk intact. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
Cover writable pool opens when the store rejects the conditional `DeleteObjects` probe. `NotImplemented` keeps the pool usable with a one-key limit. `InvalidRequest` and `InvalidArgument` must reach the caller with their original S3 error names. Clarify how the single-key probe detects delete markers on S3 buckets with enabled or suspended versioning. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
Explain why only `NoSuchKey` settles a conditional delete as `Gone`. Treating every HTTP 404 as absence could discard the deletion intent while the blob still occupies storage. Describe retries with the original `ETag` and the delete marker reported by single-key and batch deletes. https: //docs.aws.amazon.com/AmazonS3/latest/developerguide/ErrorResponses.html#ErrorCodeList Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
A failed multi-key chunk inflated `jobs_failed` by its key count, while `jobs_scheduled` counted each enqueued chunk once. Count each failed pool job once so both metrics use the same unit. Inline failures and enqueue refusals remain visible through their dedicated counters. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
The S3 disk uses `support_batch_delete` for ordinary deletes. Document that CAS probes conditional deletion independently and skips that probe when `objects_chunk_size_to_delete` is one at mount. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
Distinguish an explicit `NotImplemented` response or failed per-key checks from errors that prevent the pool from opening. Describe malformed requests and responses, persistent access failures and the retry window for transient errors. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
A shard with one delete chunk runs it inline, so an alert on `jobs_failed` misses that failure. Point operators to the phase counter for failed chunks and the round counter that also covers failed blob reads and enqueue refusals. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
Local storage also skips the batch probe when its delete limit is one. Log that limit without pointing local disk operators to an S3 setting. Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com> Co-authored-by: Codex (GPT-6) <noreply@openai.com>
`utils/ca-soak/gc-bench`: how to run the `main` profile as a GC benchmark, the five-minute collector of `system.events`, `system.cas_gc_log`, `system.cas_log` and `system.blob_storage_log`, a compose override for RustFS 1.0.7 with `RUSTFS_DURABILITY_MODE=relaxed`, and three queries (rounds, store answers, requests per GC phase). The README records how to reproduce the batch-delete overload seen with Altinity#2534 on a slow store. Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Stand results for this PR on four stores, and the changes they suggest. Head What the runs show
The cause is the same on every store: up to
Proposed changes1. Cap the keys in flight, not the number of jobs. The alternative is one chunk in flight. It is less code and enough on S3: one stream at about 1000 keys per second clears the 38800 bodies of the run in about 40 s (66 s with this PR, 189 s on the control), with no The cap bounds the keys in flight, not the rate: chunks answered faster than a second can still pass 1750 keys per second. Item 3 covers that case. 2. Chunk size follows the response time.
With this, 3. After a timeout, 4. A chunk that runs out of its window should not fail the round. 5. Counters in the 6. Elapsed time of deletes in
On the S3 stand with this PR, 8 of 151575 Not proposed
CheckRustFS 1.0.6 in |
Record the effective chunk limit, attempts that receive no response, and keys resent during the `pending_deletes` phase. Include failed attempts so an aborted round still shows how much work was retried. Record S3 delete call duration in `system.blob_storage_log`. Divide batch duration among the requested keys so a sum across their rows accounts for the call once, up to integer rounding. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
A lost response to a large conditional delete can cause GC to retry every key in the request. Divide `cas_gc_blob_delete_max_keys_in_flight` among the existing GC workers to bound the number of keys in concurrent requests from one GC. Accept budgets from `cas_gc_io_concurrency` through 1500. Round the default down to a multiple of the worker count, giving 93 keys per request with 16 workers. Co-authored-by: Codex (GPT-6) <noreply@openai.com> Signed-off-by: Konstantin Morozov <just.morozov.k@gmail.com>
|
Following up on filimonov’s original comment. The PR addresses items 1, 5, and 6 and partially addresses item 3.
The new key budget passed the focused unit tests and the RustFS integration test. Its effect on retries and |
CAS garbage collection on S3 previously sent one
DeleteObjectrequest per blob it reclaimed. When the GC fold confirms that an unreferenced blob still matches its deletion intent, it passes theETagfrom that blob’sHEADresponse topending_deletes. GC groups those blobs by shard and sends a boundedDeleteObjectsrequest with a separateETagcondition for each key. If a writer replaces a blob after the fold, the condition preserves the replacement. Once the body deletes succeed, GC removes theblob-intents/keys selected by the fold in separate write-once requests.The mount probe enables conditional batching after checking that matching objects are removed, a stale token preserves a replacement, and an already absent key is reported as
Gone. If the store rejects the entire conditionalDeleteObjectsprobe request withNotImplemented, the pool opens with a one-key limit for conditional deletes and keeps the configured GC I/O concurrency. A request-levelInvalidRequestorInvalidArgumentfails the writable mount with the original S3 error. If the S3 disk’sobjects_chunk_size_to_deletelimit drops below the size of a prepared chunk, GC fails the round withLIMIT_EXCEEDEDbefore sending that chunk.For a complete S3 response, GC keeps each key’s result in request order. When the remaining errors are retryable, such as
SlowDown, GC resends only the affected keys with their originalETagvalues. If any key reports a delete marker, GC stops the round withCAS_DELETE_MARKERand names the key, even when another key returnsSlowDown. CAS requires an S3 bucket where versioning has never been enabled. With versioningEnabledorSuspended, a delete can create a marker. On S3 the writable mount checks the result of a single-key probe delete and refuses to open the pool if that delete reports a marker.When only one key remains, CAS uses conditional
DeleteObject. OnlyNoSuchKeysettles the key asGone. A bodyless HTTP 404 leaves the outcome unknown, so CAS retries with the originalETagwithin its retry budget. UnderSingleAttempt, CAS owns credential refresh and retries. Other S3 failures identify the object key and preserve the S3 error name and type. Single-key and batch deletes shareBlobStorageLogWriter::addEvent, which accepts the bucket name as astd::string_view.If the response is lost, CAS can retry the keys from that attempt with their original
ETagvalues. If S3 returns aDeleteObjectsresponse that omits a requested key, repeats a key, or includes an unrequested key, CAS raisesCORRUPTED_DATAand does not retry the delete.On GCS, the mount skips the optional conditional batch probe for generation tokens. The S3-compatible XML
DeleteObjectsAPI rejects per-objectETagconditions. The GCS JSON batch API can group individualDELETErequests, each with its ownifGenerationMatchcondition. CAS uses the XML API, verifies single-object conditional deletion at mount, and then reclaims each blob body with a separatex-goog-if-generation-matchdelete.Local verification passed all 791 selected unit tests, including a scripted S3 test that returns
DeleteMarkeralongsideSlowDownand checks that GC reports the marked key without retrying. A focused run of 64 unit tests covered the chunk limits and verified that CAS sends exactly one delete request for each malformed response. The RustFS1.0.6integration test used the real mount probe. Each of two isolated disks reclaimed six blobs in round 2, using six conditional requests at a chunk limit of one and three at a limit of two. Round 3 removed the six deletion intents from each disk. Direct listings confirmed cleanup of both prefixes. Live AWS S3 was not tested.We recommend that QA repeat the RustFS scenario on a real Amazon S3 general purpose bucket where versioning has never been enabled. With a two-key chunk limit, verify that the writable mount logs
Conditional batch delete probe passed, that GC reclaims six blobs in the same shard using three conditionalDeleteObjectsrequests, and that a direct bucket listing confirms all six blobs are gone.Upstream PR #70786 shows how ClickHouse previously detected ordinary
DeleteObjectssupport by attempting a batch and interpreting the response.Closes: #2480
Related: #2351
Related: #2917
Related: ClickHouse#70786
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Reduce S3 delete requests during CAS garbage collection by batching retired blob body deletes with a separate
ETagcondition for each object on supported storage.Documentation entry for user-facing changes
CAS garbage collection: pending deletes
CI/CD Options
Exclude tests:
Regression jobs to run: