Skip to content

fix: default probe ports and probe-failure rollout gating#262

Merged
GrigoryPervakov merged 1 commit into
mainfrom
fix-default-probes
Jul 14, 2026
Merged

fix: default probe ports and probe-failure rollout gating#262
GrigoryPervakov merged 1 commit into
mainfrom
fix-default-probes

Conversation

@GrigoryPervakov

@GrigoryPervakov GrigoryPervakov commented Jul 13, 2026

Copy link
Copy Markdown
Member

Why

A probe or reload failure against a reachable replica no longer
escalates to StageError: the error branch updates replicas without
rollout serialization, so a transient dial failure against the healthy
peer mid-rollout could take down the last serving replica. Reload is
attempted only after a successful probe, and ReloadError now maps to
StageNotReadyUpToDate.

What

Liveness now probes /ping on the interserver port, which opens before
table loading: a slow synchronous load (async_load_databases=false,
large table count) no longer gets the container killed after ~110s.

Readiness moves to /ping on a new always-on management-http composable
protocol (9002), which opens together with client listeners after table
loading: Ready now implies the server accepts queries, keeping Service
endpoints and the rolling-update gate truthful during slow startups.

Related Issues

Related to #261

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the default ClickHouse container liveness/readiness probes to better reflect ClickHouse startup phases, aiming to prevent liveness-driven restarts during slow synchronous table loads and to make readiness imply “serving queries” (so endpoints/rollout gating are more accurate).

Changes:

  • Switch liveness probing to /ping on the interserver port (intended to open before table loading finishes).
  • Switch readiness probing to /ping on a newly introduced management HTTP port (9002).
  • Add PortManagementHTTP = 9002 and register a new management-http composable protocol/port.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/controller/clickhouse/templates.go Adjusts default liveness/readiness probe handlers and adds a new management-http composable protocol definition.
internal/controller/clickhouse/constants.go Introduces PortManagementHTTP constant used by the new readiness probe and protocol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/clickhouse/templates.go
Comment on lines 458 to 462
readinessProbe.ProbeHandler = corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/ping",
Port: intstr.FromInt32(PortInterserver),
Port: intstr.FromInt32(PortManagementHTTP),
Scheme: corev1.URISchemeHTTP,
Comment on lines +446 to 448
// Interserver listener opens before table loading, client listeners after:
// liveness survives slow synchronous loads, readiness implies serving queries.
livenessProbe := controller.DefaultLivenessProbeSettings
Liveness now probes /ping on the interserver port, which opens before
table loading: a slow synchronous load (async_load_databases=false,
large table count) no longer gets the container killed after ~110s.

Readiness moves to /ping on a new always-on management-http composable
protocol (9002), which opens together with client listeners after table
loading: Ready now implies the server accepts queries, keeping Service
endpoints and the rolling-update gate truthful during slow startups.

A probe or reload failure against a reachable replica no longer
escalates to StageError: the error branch updates replicas without
rollout serialization, so a transient dial failure against the healthy
peer mid-rollout could take down the last serving replica. Reload is
attempted only after a successful probe, and ReloadError now maps to
StageNotReadyUpToDate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@GrigoryPervakov GrigoryPervakov changed the title fix: align default probes with ClickHouse startup phases fix: default probe ports and probe-failure rollout gating Jul 14, 2026
@GrigoryPervakov GrigoryPervakov merged commit 637039c into main Jul 14, 2026
23 checks passed
@GrigoryPervakov GrigoryPervakov deleted the fix-default-probes branch July 14, 2026 13:26
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.

2 participants