You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dump_data_to_clickhouse: machine-readable report and retry of failed batches #273
dump_data_to_clickhouse is the backstop for event sink data (enrollments, users, courses), and some operators run it hourly or daily. At scale it needs to report results in a form automation can act on, and to survive the occasional failed insert into ClickHouse.
Current behaviour
Progress is logged as Last ID: <pk> after each batch. Resuming means reading the log by hand and passing --start_pk.
If a batch's HTTP insert fails, the exception propagates (base_sink.py) and the whole command stops. Nothing retries that batch.
Skipped objects are logged one by one (Skipping object <pk>, reason: ...), with no totals.
The final output is only Dumped N objects to ClickHouse.
Proposal
Retry a failed batch N times with backoff (--max_retries, --retry_backoff_secs) before giving up
--report_json PATH: per sink: objects considered, skipped (by reason), submitted, failed, first and last pk, batches, duration, exit status
--checkpoint PATH: write the last committed pk per sink after each batch, and accept it as the resume point
Exit non-zero if any batch fails after retries, with the failing pk range in the report
Acceptance criteria
Injecting a ClickHouse 5xx on one batch: the command retries and succeeds, and the report shows the retry
Killing the command and resuming from the checkpoint inserts every object exactly once (after ReplacingMergeTree dedup)
The report's counts add up: considered = skipped + submitted
Activity