Repository navigation
Count only the INSERT's own S3 requests in test_s3_disk_apply_new_settings - #127679
Conversation
…tings The test measured the S3 write requests of one INSERT by diffing the server-global `S3WriteRequestsCount` in `system.events`. In the `db disk` flavour the database disk is a `plain_rewritable` S3 disk, which since ClickHouse#121431 rewrites `__meta/snapshot.bin` from a background task `metadata_snapshot_write_delay_ms` (1000 ms) after a layout change such as the test's own CREATE TABLE. That PUT belongs to no query but bumps the global counter; when it landed in the first window the single-part count became 17 (16 data requests + 1 snapshot write) while the multi-part INSERT still took 48 = 16 * 3, failing `48 == 17 * 3` on master (Integration tests (amd_asan_ubsan, db disk, 1/8), d7b58a4 and f2c1ac3). Read each INSERT's own `ProfileEvents['S3WriteRequestsCount']` from `system.query_log` by `query_id` instead, which no background S3 traffic of the server can reach, and require the single-part count to be positive so the comparison cannot pass as `0 == 0 * 3`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (2 nits, no blocker or major).
Severity: ❌ blocker / |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261024-022700 |
|
cc @Michicosun, could you review this and add the |
|
Workflow [PR], commit [5091dfe] Summary: ✅ AI ReviewSummaryPR #127679 changes Final VerdictStatus: ✅ Approve |
7f4a629
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix flaky integration test
test_merge_tree_s3/test.py::test_s3_disk_apply_new_settingsin thedb diskflavour.Description
test_merge_tree_s3/test.py::test_s3_disk_apply_new_settingsstarted failing on master inIntegration tests (amd_asan_ubsan, db disk, 1/8)right after #121431 (2 of 15 master runs since, 0 of 310 before): d7b58a43, f2c1ac3e.The test measures the S3 requests of one INSERT by diffing the server-global
S3WriteRequestsCount. In thedb diskflavour the database metadata lives on aplain_rewritableS3 disk, which since #121431 rewrites__meta/snapshot.binfrom a background taskmetadata_snapshot_write_delay_ms(1000 ms) after a layout change, such as the test's ownCREATE TABLE. When that PUT lands in the first window, it counts 17 (16 data requests + 1 snapshot write), while the multi-part INSERT still takes 48 = 16 * 3. Both failing runs' server logs show exactly one such untagged__meta/snapshot.binPUT inside the first window.The test now reads each INSERT's own
ProfileEvents['S3WriteRequestsCount']fromsystem.query_logbyquery_id, so background S3 traffic is not counted, and checks that the single-part count is positive.Validation with the CI ASAN binary of
d7b58a43: with the snapshot delay raised to 5 s and sleeps that put the PUT inside the window (local-only), the old test fails with the CI signature(409 - 361) == (17 * 3), and the new one passes, reporting 16 for the INSERT while the global counter moved by 17. Removing theSYSTEM RELOAD CONFIGthat enables multi-part upload makes the new test fail (16 == 16 * 3). 50/50 runs with thedb diskflavour, 10/10 without it; the whole module is unchanged (23 passed, 3 skipped).🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127679]
Version info
26.11.1.748-master(included in26.11and later)