Skip to content

fix(migrations): Wait for ON CLUSTER DDL instead of failing at 5 min - #8416

Open
phacops wants to merge 2 commits into
masterfrom
fix/migrate-wait-for-clickhouse
Open

fix(migrations): Wait for ON CLUSTER DDL instead of failing at 5 min#8416
phacops wants to merge 2 commits into
masterfrom
fix/migrate-wait-for-clickhouse

Conversation

@phacops

@phacops phacops commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

ON CLUSTER migrations now wait for ClickHouse to finish instead of throwing at 5 minutes (and continuing the DDL in the background). Quiet DROP/ALTER no longer dies as IncompleteRead after that wait.

distributed_ddl_task_timeout is -1 (wait for every host; real errors still return immediately). http_send_timeout is 1h so a lock wait with no body does not close HTTP. The 15s progress interval from #8413 is re-sent on each command()/execute() because clickhouse-connect overwrites constructor settings with a 120s cap. The client timeout is None (1h urllib3 fallback) — the old 300000 was leftover milliseconds, not 5 minutes.

Tradeoff: a replica that never acks hangs the migrate job instead of failing at 5 min while ClickHouse keeps going. That matches waiting for processing.

Refs SNUBA-C3Y

distributed_ddl_task_timeout=300 threw after 5 minutes and continued the DDL async. Quiet DROP then IncompleteRead the HTTP body (SNUBA-C3Y).

Wait for every host (-1), raise http_send_timeout, and re-send the 15s progress interval per request so clickhouse-connects 120s cap does not win. Client timeout is seconds (None to 1h), not leftover milliseconds.

Refs SNUBA-C3Y
@phacops
phacops marked this pull request as ready for review August 28, 2026 21:50
@phacops
phacops requested a review from a team as a code owner August 28, 2026 21:51
Drop the extra helper and overlapping tests. Progress keys are copied in _build_query_settings, which JSONCompact now reuses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant