Repository navigation
Return retryable HTTP 503 on remote-write async insert flush timeout - #117632
Conversation
|
Workflow [PR], commit [0036062] Summary: ✅
AI ReviewSummaryThe code change itself looks correct: it introduces a dedicated PR Metadata
### Changelog category (leave one):
- Experimental Feature
Prometheus remote write now returns retryable `503 Service Unavailable` when an async insert flush times out, so compatible senders retry the write instead of dropping it.Final VerdictCode looks good. I would merge after fixing the changelog category, and optionally folding the retry rationale into the first changelog-entry paragraph. LLVM Coverage ReportMeasured on commit 0036062.
Changed lines: Changed C/C++ lines covered: 14/15 (93.33%) · Uncovered code |
54f360e to
0036062
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units9 translation units recompiled, 13 s compile time in total, 8 of them have a recent master baseline. |
|
@groeneai Investigate CI failures and suggest fixes |
CI on
|
| Check | Failure | Attribution | Owner / suggested fix |
|---|---|---|---|
Stress test (amd_debug) |
logical error Not-ready Set is passed as the second argument for function 'globalNotIn' (STID 0250-4e52) |
pre-existing, 218 unrelated pull requests in 30d | fixing PR #112968 (open) |
Stateless tests (amd_debug, parallel) |
04865_cancel_mutation_in_subquery_minmax_projection |
transient, global thread pool saturation | re-run; optional hardening below (my test) |
Not-ready Set (report). That STID pools several distinct mechanisms, so I read the chain in this job's own fatal log rather than trusting the name: Functions/in.cpp:128 -> VirtualColumnUtils.cpp:163 filterBlockWithExpression -> :419 getFilterByPathAndFileIndexes -> VirtualColumnUtils.h:136 filterByPathOrFile -> StorageObjectStorageSource.cpp:581 createFileIterator -> ReadFromObjectStorageStep.cpp:179 createIterator, reached from executeASTFuzzerQueries. So object-storage _path pruning ran at pipeline-build time against a globalNotIn set that ReadFromObjectStorageStep::applyFilters deliberately leaves unbuilt. That is exactly the route @ alexey-milovidov's #112968 fixes: it quotes the same assert and adds 04669_object_storage_path_filter_global_in. Open since 2026-08-02, labelled blocker.
Breadth over 30 days: 275 failure rows for the STID across 218 distinct pull requests and 12 true-master runs; 165 of those rows carry the VirtualColumnUtils frames above, 80 of them on globalNotIn. On Stress test (amd_debug) alone it hit 45 of 4450 trees in 14 days, so a re-run clears it in roughly 99 cases out of 100. Nothing to do on your side; it will keep appearing until #112968 lands.
04865 (report). No assertion of the test failed: stdout matched the reference in full (1, 0, 15 120, 7, 1) and the recorded reason is having stderror. The stderr came from the bounded wait loop at line 85, whose SYSTEM FLUSH LOGS part_log; SELECT countIf(errorCodeToName(error) = 'ABORTED') > 0 FROM system.part_log ... threw Code: 439. Cannot schedule a task: no free thread (timeout=60000000) (threads=3, jobs=3). (CANNOT_SCHEDULE_TASK) on one attempt. The loop compares stdout only, so it retried and succeeded, which is why the output is complete.
Mechanism: that run drew --max_threads 3, so MergeTreeDataSelectExecutor::filterPartsByPrimaryKeyAndSkipIndexes took the parallel branch and built a 3-thread pool for index analysis over system.part_log. That pool borrows threads from the global pool and uses scheduleOrThrow on purpose, to avoid blocking forever when the global pool is saturated (the comment at MergeTreeDataSelectExecutor.cpp:1277), with the wait bounded by lock_acquire_timeout, which CI pins to 60 s in tests/config/users.d/limits.yaml:53. The global pool stayed full for those 60 s. Nothing about a remote-write error code can influence that.
Rate: 5328 OK and this single FAIL on that job in 14 days, this exact thread pool signature appears once fleet-wide in 7 days, and the runner's own randomized-settings diagnosis re-ran the test 10 times with the same settings for 10 passes. A re-run is enough.
The test is mine (it came with #114463), so the suggested fix is on me. Its three wait loops (lines 48, 63, 85) each already fail loudly with their own message on timeout, so a per-attempt server error has no reason to reach stderr; redirecting stderr inside those loops removes this whole class. The narrower alternative is SETTINGS max_threads = 1 on the system.part_log probe, which takes the serial branch at MergeTreeDataSelectExecutor.cpp:1263 and never borrows from the global pool. At one occurrence in 7 days I am not raising it as work of its own, but say the word and I will send it.
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
PromQL Compliance ReportBaseline: S3 master
Note: score is unchanged vs baseline. |
a748a45
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Return retryable
503 Service Unavailableon remote-write async insert flush timeout.Earlier it returned
HTTP 408 Request Timeout, which was bad because Prometheus Remote Write compatible senders retry write requests only on HTTP 5xx responses (and sometimes HTTP 429) (docs) soHTTP 408was not retryableWorkflow [PR]
Sync PR [sync-upstream/pr/117632]
Version info
26.9.1.588(included in26.9and later)