发布

  • [OPIK-6905] [BE] feat: cluster + cold_s3 disk ClickHouse health checks (#7419)

    frostbyte_neo 发布于 2026-07-13 07:29:39 +00:00

    • [OPIK-6905] [BE] feat: cluster + cold_s3 disk ClickHouse health checks

    Add two toggle-gated ClickHouse existence health checks for the Hyperscale
    topology:

    • clickhouse-cluster: fails readiness when the Distributed cluster definition
      ('cluster') isn't visible from the node (system.clusters).
    • clickhouse-cold-storage-disk: fails readiness when the 'cold_s3' tiered
      storage disk isn't reachable (system.disks).

    Both are gated by new databaseAnalytics flags (clusterHealthCheckEnabled /
    coldStorageDiskHealthCheckEnabled), default off, so single-shard / OSS Docker
    deployments are unaffected. Because a count() query succeeds returning 0 when
    the resource is absent, the shared base reads the count and reports unhealthy
    when it is zero, reusing the existing timeout / max_execution_time /
    cancel-on-failure machinery.

    • refactor(healthcheck): share probe execution + add log_comment

    Address PR review: extract the timeout/cancel/interrupt flow into a shared
    AbstractClickHouseHealthCheck.executeProbe(future, resultMapper) so the
    existence probes supply only the query and result mapping instead of
    duplicating the flow. Add a log_comment (health_check:) to the shared
    newQuerySettings() so every probe query is traceable in system.query_log
    (per .agents/skills/opik-backend/clickhouse.md); the read-only probe still
    overrides newQuerySettings() to null and is unaffected. Strengthen the unit
    matcher to assert log_comment on every enabled probe path.

    下载附件