Repository navigation
S3Queue: clear stale .retriable marker on terminal failure and skip terminalization while processing - #125565
S3Queue: clear stale .retriable marker on terminal failure and skip terminalization while processing#125565adityaksolves wants to merge 22 commits into
Conversation
Adds the failed_files_ttl_sec engine setting, which controls time-based expiry of terminal failed files in unordered mode. tracked_files_limit's description is also updated to document that it caps the failed-files set by count in both ordered and unordered mode, independently of the new setting. For tables created before this setting existed, the value is inherited from tracked_file_ttl_sec at attach time; this inheritance is a one-time fallback and is not kept in sync with later changes to tracked_file_ttl_sec.
…che reconciliation
…arker in waitForPathToBeProcessed
…ck in hash-ring path; fix retriable marker test helper
…r a cache-hot Failed file
…erminalization while processing
Cover clearing the .retriable marker on terminal failure, and skipping terminalization of an exhausted marker while /processing/<hash> exists.
|
Workflow [PR], commit [f5e0703] Summary: ✅
AI ReviewSummaryAt Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block. Preserve legacy ordered TTL behavior, carry both wait corrections into the reviewed stack, batch claim-side marker reads, and make the processing-owner regression deterministic. These corrections may land in the dependency where appropriate, but must be present in the resulting diff before approval. |
…f the construction-time snapshot
|
@nihalzp Config Workflow is failing on the latest run (commit 6e593ea) in the Check CI DB step (connection refused to play.clickhouse.com), so all other jobs are DROPPED. The previous run on 80815bd passed this step, so this looks like a transient CI infrastructure issue. Could you please re-run the workflow? Thanks! |
| if not zk.exists(planted_processing_path): | ||
| zk.create( | ||
| planted_processing_path, | ||
| b"test-processing-owner", | ||
| makepath=True, | ||
| ) |
There was a problem hiding this comment.
The materialized view is still retrying this file when this check runs. If zk.exists sees a real retry's processing node, the test skips creating its own node; after the limit is lowered, that worker legitimately fails, removes its processing node, and clears the marker. The assertions after the three-second wait then fail even with the fix. If the node is absent, the worker can also claim it between exists and create, producing NodeExistsError.
Please synchronize the retry worker before establishing this precondition, or pause a real in-flight retry and explicitly wait for that pause. The test must know that its processing owner remains present until it releases the owner; sampling a transient node and waiting a fixed duration does not establish that.
There was a problem hiding this comment.
Noted. I will make the owner synchronization deterministic if the test turns out flaky in CI.
|
@adityaksolves For such issues, you can push a new commit to rerun the CI. |
Related: #113054
Depends on #121752 (the diff also shows #121752's commits until it is merged; the new commits here are a35f313, 80815bd and 6e593ea).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
S3Queue: when a file fails permanently, its leftover
.retriableretry marker is now cleared, a file that is still being processed is no longer marked as permanently failed, and loweringloading_retriesis now honored immediately by files that were already queued for retry.Detailed description
This is a follow-up PR from the split of #113784. It covers the stale
.retriablecleanup item.Problem:
/failed/<hash>was created but the.retriablemarker was not removed, so both nodes could exist together.tryTerminalizeExhaustedRetriableMarker()could terminalize a marker while/processing/<hash>still existed, i.e. while the file was being processed.max_loading_retriesvalue captured at construction time, so aFileMetadatareused viaFileIterator::returnForRetry()could miss a later decrease ofloading_retriesand hand out one extra processing attempt.Fix:
.retriablemarker is cleared in the same Keeper multi-op that removes the processing node and creates/failed/<hash>.tryTerminalizeExhaustedRetriableMarker()returns false if/processing/<hash>exists.isRetriableMarkerExhausted,hasNonProcessableState,trySetProcessingandprepareSetProcessingRequestsnow compare against the liveloading_retries_ref.load()instead of the construction-timemax_loading_retriessnapshot (6e593ea).Tests (
test_failed_files_ttl.py):test_terminal_failure_clears_stale_retriable_markertest_processing_path_blocks_retriable_terminalizationKnown limitation: the processing-node existence check and the terminalization multi-op are separate Keeper operations, so a narrow race window remains. This PR does not claim to remove it completely.
Verification status: both tests fail without the fix, with the expected assertions. They have not yet been verified green with the fix; CI results are pending.
Not in this PR
LIKE 'prefix/%'filter inSYSTEM DROP.getPathState()/is_terminal_outfix (tracked in S3Queue: allow altering tracked_files_limit in ordered mode and fix exclusive-mode failure terminality #125604).Workflow [PR]
Sync PR [sync-upstream/pr/125565]