Skip to content

chore(weave): add calls_merged to calls_complete backfill driver#7535

Draft
gtarpenning wants to merge 6 commits into
masterfrom
griffin/calls-complete-backfill-driver
Draft

chore(weave): add calls_merged to calls_complete backfill driver#7535
gtarpenning wants to merge 6 commits into
masterfrom
griffin/calls-complete-backfill-driver

Conversation

@gtarpenning

@gtarpenning gtarpenning commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • operator script (scripts/backfill_calls_complete.py) migrating dormant projects from calls_merged to calls_complete via an invisible staging table published with ATTACH PARTITION FROM
  • phases: plan / fill / verify / stats / attach; allowlist-driven, resumable journal, attach-once enforcement, dry-run
  • no service code changes: routing flips reactively by data presence; stats inserted explicitly since the MV does not fire on ATTACH
  • parity math excludes the two validated known losses (end-only fragments, rows past per-row retention)

QA campaign (816 projects, 100.1M calls, zero parity violations)

step fill verify + spot-check stats insert ATTACH (cutover) post-attach
p50 / worst 0.4s / 1655s sub-second / 110s 2s / 279s 0.26-0.9s rows/stats exact, 0 dupes

Three error classes hit and fixed along the way:

  • Cloud replicas lag part metadata, so read-after-write verification can silently undercount (worst case 0 of 100k rows visible) -> all verification reads use select_sequential_consistency=1
  • transient Keeper ZNODEEXISTS (code 244, ~0.4% of fills) on staging drop/recreate under the same name -> tenacity retry mirroring the migrator's transient-code pattern
  • whale fills OOM: cityHash64(id) % N rescans the project per bucket without cutting aggregation state, and fixed hex ranges collapse to one bucket on time-ordered UUIDv7 ids -> adaptive id-range chunking (--chunk-rows) across plan/fill/verify/stats; a 32.6M-call project then ported in 690s on a 14 GiB cluster

Testing

local CH 25.12 end-to-end with adversarially fragmented seed data; full QA-cluster campaign journals + reports in scripts/backfill_runs/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

gtarpenning and others added 5 commits July 7, 2026 16:47
…eads

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cityHash64(id) % N bucketing rescans the full project per bucket without
reducing aggregation state, and fixed hex-prefix ranges collapse to a single
bucket on time-ordered UUIDv7 ids. Replace with adaptive prefix drilling so
every plan/fill/verify/stats query touches <= --chunk-rows ids, plus external
group-by spill and single-replica aggregation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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