Repository navigation
feat: backport xatu run, embedded ClickHouse schema and cannon ClickHouse coordinator to pq-devnet-1 - #1016
Conversation
The xatu migration set is now compiled into the binary.
`xatu migrate clickhouse --dsn <dsn>` creates the DSN's database on the
'{cluster}' cluster if it is missing and applies the set to it, keeping
state in schema_migrations_xatu like the golang-migrate CLI does, so the
two can be mixed on one database. The image and its schema can no longer
drift apart.
Co-authored-by: Sam Calder-Mason <samcaldermason@gmail.com>
…ype clickhouse Cannon needed a xatu server with Postgres just to remember where each deriver is. coordinator.type: clickhouse keeps that in a cannon_location ReplacingMergeTree table in the DSN's database instead, created on start if missing, so a cannon writing straight to ClickHouse needs nothing else. The default stays grpc. Co-authored-by: Sam Calder-Mason <samcaldermason@gmail.com>
xatu run reads one config with a shared ClickHouse DSN and a services
list of {name, type, config} entries, where config takes the same keys as
xatu <type>. It applies the embedded schema to the DSN's database, then
starts each service writing straight to it: the server with a ClickHouse
output ahead of its own outputs, and cannon with the same output and its
positions in ClickHouse. One metrics listener serves every service, so a
service skips its own when metricsAddr is empty. Server and cannon are
supported, at most one of each.
Co-authored-by: Sam Calder-Mason <samcaldermason@gmail.com>
There was a problem hiding this comment.
Backports xatu migrate clickhouse (embedded schema), the ClickHouse cannon coordinator, and xatu run onto release/pq-devnet-1. I traced the run orchestration, the migration DSN/URL handling and driver behaviour (multi-statement split, x-migrations-table, database creation), the new coordinator store, and the metrics-registration paths; the new deps (clickhouse-go v1.4.3, golang-migrate v4.20.1) are OSV-clean and the pgx bump actually clears a critical advisory. The change looks sound; I have one non-blocking design question about the coordinator table's engine.
Design Notes
💭 Should cannon_location replicate like the rest of the schema? (pkg/cannon/coordinator/clickhouse.go)
- Risk: It is created as a local
ReplacingMergeTreewith noON CLUSTER, so on a multi-node ClickHouse (docs/run.md says the DSN's database needs a{cluster}macro and Keeper because the schema is replicated) a cannon that lands on another replica reads no position and takes the fresh-start path, silently restarting at the finalized ceiling. - Option: Create it
ON CLUSTER '{cluster}'withReplicatedReplacingMergeTree(as every table indeploy/migrations/clickhouse/xatuis), or state in docs/run.md and docs/cannon.md thatcoordinator.type: clickhouseneeds a single node.
Reviewed 22 changed file(s) @ 8b5c4fc3 — no blocking issues found.
"Backups are useless. Restores are everything."
Backports #1013, #1014 and #1015 to
release/pq-devnet-1, so a local devnet can runxatu runwith this branch's schema, including theotel_*tables that client telemetry from ethpandaops/ethereum-package#1551 lands in.The three commits cherry-picked without conflicts. On a single ClickHouse node,
xatu runapplied the embedded set tokurtosis(version 40, including the 19otel_*tables), and the server and cannon passed their table and column checks against it. The cannon, iterator, clickhouse and cmd test suites pass.