feat(plugin-backfill): async query submission with concurrency and polling#98
Merged
feat(plugin-backfill): async query submission with concurrency and polling#98
Conversation
…ion and polling Switch backfill execution from synchronous per-chunk queries to async query submission via ClickHouse's fire-and-forget mode with server-side polling through system.processes and system.query_log. Adds configurable concurrency (--concurrency) and poll interval (--poll-interval) flags. Removes the old sequential executor, runtime orchestration, simulation flags, compatibility tokens, and event logging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rance, and replay-failed - Add syncProgress() to reconcile local checkpoint state with ClickHouse system.processes/query_log, recovering from client crashes mid-backfill - Add afterTime filter to queryStatus() to ignore stale query_log entries when resubmitting with deterministic query IDs - Add maxPollErrors option for transient network error tolerance during polling - Move replayFailed logic into executeBackfill for correct ordering (sync first, then reset confirmed-failed chunks) - Make plugin.ts enforce explicit resume flow: run command rejects existing runs instead of silently continuing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…test timeouts Return exit code 0 with informational message when resuming an already-completed backfill instead of throwing an error. Increase E2E test timeouts to 120s for async query polling reliability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…llReplicas
queryStatus and syncProgress queried system.processes and system.query_log
on a single node, but submit() could route the INSERT to a different replica.
On multi-replica deployments, the poll loop would never find the query,
causing backfill runs to hang indefinitely.
Use clusterAllReplicas('parallel_replicas', ...) with skip_unavailable_shards=1
to fan out across all nodes. Add is_initial_query=1 filter to avoid matching
distributed sub-query log entries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
67e8f8a to
419d183
Compare
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.
Summary
wait_end_of_query: 0fire-and-forget modesubmit()andqueryStatus()to@chkit/clickhouse'sClickHouseExecutorfor async query lifecycle managementexecuteBackfill()orchestrator in@chkit/plugin-backfillusingp-mapfor configurable concurrency and server-side polling viasystem.processes/system.query_log--concurrency,--poll-interval, and--replay-failedflagsTest plan
🤖 Generated with Claude Code