Skip to content

Don't handle timeout_overflow_mode='break' in ReplicatedMergeTreeSink::waitForQuorum - #107760

Merged
nickitat merged 1 commit into
masterfrom
fix_quorum_wait
Jun 18, 2026
Merged

nickitat merged 1 commit into
masterfrom
fix_quorum_wait

Conversation

@nickitat

@nickitat nickitat commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

#107513 caused failures in CI, and we decided to reconsider the behaviour with timeout_overflow_mode='break'.

Version info

  • Merged into: 26.6.1.976

@clickhouse-gh

clickhouse-gh Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [735a53d]

Summary: ✅


AI Review

Summary

The PR changes ReplicatedMergeTreeSink::waitForQuorum so timeout_overflow_mode = 'break' no longer escalates an expired max_execution_time into TIMEOUT_EXCEEDED; the quorum wait continues until quorum is satisfied or insert_quorum_timeout reports UNKNOWN_STATUS_OF_INSERT. The implementation is small, but the updated regression test does not exercise the changed checkTimeLimit false-return path, so I cannot approve it yet.

Missing context / blind spots
  • ⚠️ The PR body only selects Not for changelog and does not explain why timeout_overflow_mode = 'break' should ignore max_execution_time while a quorum INSERT is already waiting. A short rationale or linked issue would close this.
Tests
  • ⚠️ [tests/queries/0_stateless/04337_quorum_insert_honors_time_limit.sql:50] The break case sets insert_quorum_timeout = 3000 and max_execution_time = 300, so the query reaches the quorum timeout before checkTimeLimit can return false. This would pass even if the PR did not correctly ignore the false return in waitForQuorum. Add focused coverage where max_execution_time expires while the query is already waiting for quorum and insert_quorum_timeout is still in the future, then assert that the query continues to the quorum timeout and reports UNKNOWN_STATUS_OF_INSERT.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: add deterministic coverage for the timeout_overflow_mode = 'break' false-return path inside the quorum wait.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 17, 2026
INSERT INTO quorum_break_r1
SETTINGS insert_quorum = 2, insert_quorum_parallel = 0, insert_quorum_timeout = 6000000, max_execution_time = 3, timeout_overflow_mode = 'break', async_insert = 0, insert_keeper_fault_injection_probability = 0
VALUES (1); -- { serverError TIMEOUT_EXCEEDED }
SETTINGS insert_quorum = 2, insert_quorum_parallel = 0, insert_quorum_timeout = 3000, max_execution_time = 300, timeout_overflow_mode = 'break', async_insert = 0, insert_keeper_fault_injection_probability = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting means the break case never exercises the behavior this PR changes. insert_quorum_timeout = 3000 bounds the wait at about 3 seconds, while max_execution_time = 300 leaves checkTimeLimit returning true for the whole wait, so this test would still pass if the new waitForQuorum call ignored no false return at all.

Please add focused coverage where max_execution_time expires while the query is already waiting for quorum and insert_quorum_timeout is still in the future, then assert that the query continues to the quorum timeout and reports UNKNOWN_STATUS_OF_INSERT. A small shell test like 04338_kill_quorum_insert can make this deterministic by starting the quorum INSERT, waiting until it is blocked in the quorum wait, and only then observing the result.

@nickitat
nickitat marked this pull request as ready for review June 17, 2026 17:00
@clickhouse-gh

clickhouse-gh Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.20% 85.20% +0.00%
Functions 92.30% 92.30% +0.00%
Branches 77.50% 77.50% +0.00%

Changed lines: Changed C/C++ lines covered by tests: 7/7 (100.00%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 8 line(s) · Uncovered code

Full report · Diff report

@nickitat
nickitat enabled auto-merge June 18, 2026 10:44
@nickitat
nickitat added this pull request to the merge queue Jun 18, 2026
Merged via the queue into master with commit e6da78a Jun 18, 2026
546 of 648 checks passed
@nickitat
nickitat deleted the fix_quorum_wait branch June 18, 2026 11:23
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants