Fix flaky test_write_failover in test_merge_tree_s3_failover#96716
Merged
alexey-milovidov merged 1 commit intomasterfrom Feb 12, 2026
Merged
Fix flaky test_write_failover in test_merge_tree_s3_failover#96716alexey-milovidov merged 1 commit intomasterfrom
alexey-milovidov merged 1 commit intomasterfrom
Conversation
The S3 proxy endpoint counted all HTTP methods (GET, POST, PUT, DELETE) toward its fail counter. When a previous INSERT failed partway through writing part files, ClickHouse would clean up the partially written files via DELETE requests. These background DELETE/GET requests could race with the next iteration's `fail_request()` call, consuming the counter before the INSERT's PUT requests, causing the INSERT to succeed earlier than expected. The fix adds optional HTTP method filtering to the proxy's `fail_request` endpoint (`/fail_request/<N>/<method>`). The `test_write_failover` test now uses `fail_request(N, "PUT")` to only count PUT requests, so background cleanup operations no longer interfere with the counter. Other tests (`test_move_failover`, `test_retry_loading_parts`, `test_throttle_retry`) are unaffected as they continue using the unfiltered `fail_request(N)`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96705&sha=8a70737430373209132a005dc88f94f9bd2962af&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%202%2F4%29 Closes #96649 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
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.
The S3 proxy endpoint's fail counter was consumed by background GET/DELETE requests (e.g. cleanup of partially written parts from failed INSERTs), causing the INSERT to succeed earlier than expected.
Added optional HTTP method filtering to the proxy's
fail_requestendpoint sotest_write_failovercounts only PUT requests. Other tests in the same suite are unaffected (they use unfilteredfail_request).CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96705&sha=8a70737430373209132a005dc88f94f9bd2962af&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%202%2F4%29
#96705
Closes #96649
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes