Repository navigation
Fix flaky test 04043_system_asynchronous_inserts_user_filter - #100233
Merged
Merged
Conversation
Add `no-parallel` tag because the test relies on a pending async insert remaining in the queue. Concurrent tests that run `SYSTEM FLUSH ASYNC INSERT QUEUE` drain all shards globally, removing the entry before the subsequent SELECT queries can observe it. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [8d9535d] Summary: ✅ AI ReviewSummaryThis PR updates ClickHouse Rules
Final Verdict
|
Member
Author
george-larionov
marked this pull request as ready for review
March 20, 2026 20:44
1 task done
pull Bot
pushed a commit
to sowelswl/ClickHouse
that referenced
this pull request
May 25, 2026
The test was failing on master (and many open PRs) under sanitizer and S3 builds with both `secret_user sees:` and `admin sees:` returning 0 — i.e. the queued async insert was no longer in `system.asynchronous_inserts` by the time the user-filter `SELECT` queries ran. PR ClickHouse#103032 dropped the `no-parallel` tag added in ClickHouse#100233 on the premise that all unscoped `SYSTEM FLUSH ASYNC INSERT QUEUE` callers were migrated to the table-scoped variant. The premise holds for the tests that *call* flush, but this test does not call flush at all — it relies on the opposite: a pending entry must remain in the queue between `INSERT` and the three subsequent `SELECT` queries. Any concurrent unscoped flush drains it, and even without that there is a residual race in slow CI environments where the entry's visibility through `system.asynchronous_inserts` can lag the client return. Re-add `no-parallel` with a comment that captures the real reason (the test consumes pending state, it does not produce it), disable `async_insert_use_adaptive_busy_timeout` so the per-query 10-minute deadline is honored exactly and `max_busy_timeout_exceeded` cannot force an early flush when the shard has been idle, and poll `system.asynchronous_inserts` for up to 30 seconds before running the user-filter checks so the test fails clean on a real visibility bug instead of racing the queue. CI history: https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIHRvU3RhcnRPZkRheShjaGVja19zdGFydF90aW1lKSBBUyBkYXksCiAgICBjb3VudCgpIEFTIGZhaWx1cmVzLAogICAgZ3JvdXBVbmlxQXJyYXkocHVsbF9yZXF1ZXN0X251bWJlcikgQVMgcHJzLAogICAgYW55KHJlcG9ydF91cmwpIEFTIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDA0M19zeXN0ZW1fYXN5bmNocm9ub3VzX2luc2VydHNfdXNlcl9maWx0ZXInCiAgICBBTkQgdGVzdF9zdGF0dXMgSU4gKCdGQUlMJywgJ0VSUk9SJykKICAgIEFORCAocHVsbF9yZXF1ZXN0X251bWJlciA9IDAgT1IgYmFzZV9yZWYgSU4gKCdtYXN0ZXInKSkKICAgIEFORCB0ZXN0X2NvbnRleHRfcmF3IExJS0UgJyVyZXN1bHQgZGlmZmVycyB3aXRoIHJlZmVyZW5jZSUnCkdST1VQIEJZIGRheQpPUkRFUiBCWSBkYXkgREVTQwo=
DavidHe-2008
pushed a commit
to DavidHe-2008/ClickHouse
that referenced
this pull request
Jun 1, 2026
The test was failing on master (and many open PRs) under sanitizer and S3 builds with both `secret_user sees:` and `admin sees:` returning 0 — i.e. the queued async insert was no longer in `system.asynchronous_inserts` by the time the user-filter `SELECT` queries ran. PR ClickHouse#103032 dropped the `no-parallel` tag added in ClickHouse#100233 on the premise that all unscoped `SYSTEM FLUSH ASYNC INSERT QUEUE` callers were migrated to the table-scoped variant. The premise holds for the tests that *call* flush, but this test does not call flush at all — it relies on the opposite: a pending entry must remain in the queue between `INSERT` and the three subsequent `SELECT` queries. Any concurrent unscoped flush drains it, and even without that there is a residual race in slow CI environments where the entry's visibility through `system.asynchronous_inserts` can lag the client return. Re-add `no-parallel` with a comment that captures the real reason (the test consumes pending state, it does not produce it), disable `async_insert_use_adaptive_busy_timeout` so the per-query 10-minute deadline is honored exactly and `max_busy_timeout_exceeded` cannot force an early flush when the shard has been idle, and poll `system.asynchronous_inserts` for up to 30 seconds before running the user-filter checks so the test fails clean on a real visibility bug instead of racing the queue. CI history: https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIHRvU3RhcnRPZkRheShjaGVja19zdGFydF90aW1lKSBBUyBkYXksCiAgICBjb3VudCgpIEFTIGZhaWx1cmVzLAogICAgZ3JvdXBVbmlxQXJyYXkocHVsbF9yZXF1ZXN0X251bWJlcikgQVMgcHJzLAogICAgYW55KHJlcG9ydF91cmwpIEFTIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDA0M19zeXN0ZW1fYXN5bmNocm9ub3VzX2luc2VydHNfdXNlcl9maWx0ZXInCiAgICBBTkQgdGVzdF9zdGF0dXMgSU4gKCdGQUlMJywgJ0VSUk9SJykKICAgIEFORCAocHVsbF9yZXF1ZXN0X251bWJlciA9IDAgT1IgYmFzZV9yZWYgSU4gKCdtYXN0ZXInKSkKICAgIEFORCB0ZXN0X2NvbnRleHRfcmF3IExJS0UgJyVyZXN1bHQgZGlmZmVycyB3aXRoIHJlZmVyZW5jZSUnCkdST1VQIEJZIGRheQpPUkRFUiBCWSBkYXkgREVTQwo=
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.
Resolves #100231
Add
no-paralleltag because the test relies on a pending async insert remaining in the queue. Concurrent tests that runSYSTEM FLUSH ASYNC INSERT QUEUEdrain all shards globally, removing the entry before the subsequent SELECT queries can observe it.Changelog category (leave one):
Version info
26.4.1.75