Skip to content

Keeper readiness probes fail when upgrading setups #1856

Closed

Description

@dashashutosh24

With release https://github.com/Altinity/clickhouse-operator/releases/tag/release-0.25.5 , readiness probes have been added back to clickhouse-keeper. But this upgrade prevents cluster formation for fresh setups.
@alex-zaitsev I found one thing. While the readiness probe addition works when you upgrade existing installations with probes however the same fails on fresh installations as the pod itself keeps failing readiness check while trying to resolve the FQDN for other hosts in the cluster. I see logs such as the following for a fresh setup with readiness probes.

2025.10.28 09:41:26.967231 [ 65 ] {} <Information> RaftInstance: [ELECTION TIMEOUT] current role: candidate, log last term 8, state term 8, target p 1, my p 1, hb dead, pre-vote NOT done
2025.10.28 09:41:26.967248 [ 65 ] {} <Warning> RaftInstance: total 1 nodes (including this node) responded for pre-vote (term 8, live 0, dead 1), at least 2 nodes should respond. failure count 10
2025.10.28 09:41:26.967262 [ 65 ] {} <Information> RaftInstance: [PRE-VOTE INIT] my id 0, my role candidate, term 8, log idx 716359, log term 8, priority (target 1 / mine 1)
2025.10.28 09:41:26.967270 [ 65 ] {} <Warning> RaftInstance: failed to send prevote request: peer 2 (chk-clickhouse-keeper-chkeeper-chkeeper-0-2:9444) is busy
2025.10.28 09:41:26.967280 [ 65 ] {} <Warning> RaftInstance: failed to send prevote request: peer 1 (chk-clickhouse-keeper-chkeeper-chkeeper-0-1:9444) is busy
2025.10.28 09:41:28.845396 [ 64 ] {} <Warning> RaftInstance: Election timeout, initiate leader election
2025.10.28 09:41:28.845469 [ 64 ] {} <Information> RaftInstance: [PRIORITY] decay, target 1 -> 1, mine 1
2025.10.28 09:41:28.845483 [ 64 ] {} <Information> RaftInstance: [ELECTION TIMEOUT] current role: candidate, log last term 8, state term 8, target p 1, my p 1, hb dead, pre-vote NOT done
2025.10.28 09:41:28.845497 [ 64 ] {} <Warning> RaftInstance: total 1 nodes (including this node) responded for pre-vote (term 8, live 0, dead 1), at least 2 nodes should respond. failure count 11
2025.10.28 09:41:28.845521 [ 64 ] {} <Information> RaftInstance: [PRE-VOTE INIT] my id 0, my role candidate, term 8, log idx 716359, log term 8, priority (target 1 / mine 1)
2025.10.28 09:41:28.845529 [ 64 ] {} <Warning> RaftInstance: failed to send prevote request: peer 2 (chk-clickhouse-keeper-chkeeper-chkeeper-0-2:9444) is busy
2025.10.28 09:41:28.845539 [ 64 ] {} <Warning> RaftInstance: failed to send prevote request: peer 1 (chk-clickhouse-keeper-chkeeper-chkeeper-0-1:9444) is busy
2025.10.28 09:41:29.681296 [ 67 ] {} <Warning> RaftInstance: peer (2) response error: failed to resolve host chk-clickhouse-keeper-chkeeper-chkeeper-0-2 due to error 2, Host not found (non-authoritative), try again later
2025.10.28 09:41:30.015660 [ 66 ] {} <Warning> RaftInstance: Election timeout, initiate leader election
2025.10.28 09:41:30.015747 [ 66 ] {} <Information> RaftInstance: [PRIORITY] decay, target 1 -> 1, mine 1
2025.10.28 09:41:30.015767 [ 66 ] {} <Information> RaftInstance: [ELECTION TIMEOUT] current role: candidate, log last term 8, state term 8, target p 1, my p 1, hb dead, pre-vote NOT done
2025.10.28 09:41:30.015785 [ 66 ] {} <Information> RaftInstance: reset RPC client for peer 2
2025.10.28 09:41:30.015909 [ 66 ] {} <Warning> RaftInstance: total 1 nodes (including this node) responded for pre-vote (term 8, live 0, dead 1), at least 2 nodes should respond. failure count 12
2025.10.28 09:41:30.015929 [ 66 ] {} <Information> RaftInstance: [PRE-VOTE INIT] my id 0, my role candidate, term 8, log idx 716359, log term 8, priority (target 1 / mine 1)
2025.10.28 09:41:30.015948 [ 66 ] {} <Warning> RaftInstance: failed to send prevote request: peer 1 (chk-clickhouse-keeper-chkeeper-chkeeper-0-1:9444) is busy

As a result, the first replica itself is stuck and cluster doesn't progress towards completion. But while upgrading, since hosts already exist, I think that is why cluster formation succeeds.
Related issue: #1846

Activity

  1. alex-zaitsev commented on Nov 6, 2025

    @alex-zaitsev
    Member

    Thanks. This is weird, we do not see it in tests. Needs to be investigated.

  2. alex-zaitsev commented on Nov 7, 2025

    @alex-zaitsev
    Member

    @dashashutosh24 , can not reproduce it so far. Here is 3-node CHK fresh start in tests:

    test-020003-570ea5fc-bbea-11f0-a64b-acde48001122   chk-clickhouse-keeper-test-0-0-0      1/1     Running   0                 83s
    test-020003-570ea5fc-bbea-11f0-a64b-acde48001122   chk-clickhouse-keeper-test-0-1-0      1/1     Running   0                 76s
    test-020003-570ea5fc-bbea-11f0-a64b-acde48001122   chk-clickhouse-keeper-test-0-2-0      1/1     Running   0                 68s
    

    Pods are started almost in parallel

  3. added
    Keeper
    on Dec 11, 2025
  4. devmaxnsk commented on Feb 27, 2026

    @devmaxnsk

    Faced similar issue on my k3s lab, fresh install. 3-node k3s v1.34.3. no IPv6, no SELinux, k3s-embedded iptables bin.

    1. Deploy operator: curl -s https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator-web-installer/clickhouse-operator-install.sh | OPERATOR_NAMESPACE=nova bash
    2. Deploy 3-node keeper manifest from repository examples

    First pod of keeper keeps failing and restarts 3 times due to impossibility to resolve hostnames of instances 1 and 2:

    2026.02.27 21:19:46.689540 [ 1 ] {} <Warning> DNSResolver: Cannot resolve host (chk-keeper-clickhouse-nova-0-1), error 0: Host not found.
    2026.02.27 21:19:46.689824 [ 1 ] {} <Error> bool DB::(anonymous namespace)::isLocalhost(const std::string &): Code: 198. DB::NetException: Not found address of host: chk-keeper-clickhouse-nova-0-1. (DNS_ERROR), Stack trace (when copying this message, always include the lines below):
    
    0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000115c14ea
    1. DB::Exception::Exception(String&&, int, String, bool) @ 0x0000000009324ece
    2. DB::NetException::NetException<String const&>(int, FormatStringHelperImpl<std::type_identity<String const&>::type>, String const&) @ 0x0000000011597481
    3. DB::DNSResolver::getResolvedIPAddressesWithFiltering(String const&) @ 0x0000000011596be6
    

    Operator logs:
    It waits for keeper instance 0 to start:

    I0227 21:14:58.348977       1 statefulset-reconciler.go:431] waitHostStatefulSetToLaunch():Host:0-0[0/0]:nova/keeper:Wait host pod started. Host: 0-0
    I0227 21:15:03.349732       1 poller.go:80] Poll():nova/0-0:OK nova/0-0
    I0227 21:16:03.359510       1 poller.go:117] Poll():nova/0-0:WAIT: nova/0-0
    I0227 21:16:08.360780       1 poller.go:117] Poll():nova/0-0:WAIT: nova/0-0
    ...
    

    5 minutes later the poll fails with timeout and continues with creating instances 1 and 2:

    I0227 21:20:03.400665       1 poller.go:108] Poll():nova/0-0:poll(nova/0-0) - TIMEOUT reached
    W0227 21:20:03.400698       1 poller-host-objects.go:84] WaitHostPodStarted():FAILED wait Pod to reach started status
    E0227 21:20:03.400715       1 statefulset-reconciler.go:433] waitHostStatefulSetToLaunch():Host:0-0[0/0]:nova/keeper:Host pod wait failed. host: 0-0 err: poll(nova/0-0) - wait timeout
    E0227 21:20:03.400730       1 statefulset-reconciler.go:418] doCreateStatefulSet():Host:0-0[0/0]:nova/keeper:StatefulSet create wait failed. err: poll(nova/0-0) - wait timeout
    W0227 21:20:03.409938       1 statefulset-reconciler.go:385] shouldAbortOrContinueCreateStatefulSet():Host:0-0[0/0]:nova/keeper:Create StatefulSet: nova/chk-keeper-clickhouse-nova-0-0 - error ignored
    

    Once instances 1 and 2 are provisioned, instance 0 is started successfully.
    Overall keeper cluster deployment takes more than 5 minutes.

  5. alex-zaitsev commented on Mar 13, 2026

    @alex-zaitsev
    Member
  6. bmassemin commented on Mar 13, 2026

    @bmassemin

    I think the problem is still present, or even worse, because now it no longer ends up deploying the other pods, and it stays stuck on a single pod.

  7. Slach commented on Mar 15, 2026

    @Slach
    Collaborator

    @bmassemin did you upgrade CRDs and operator to 0.26.1?

    could you share operator logs and keeper statefulset logs?

  8. bmassemin commented on Mar 15, 2026

    @bmassemin

    I had rolled back to 0.26.0, and in order to provide you with the logs I switched back to 0.26.1 and deployed a new keeper cluster. And now everything is working, so I assume something was going wrong during my first attempt.
    Sorry for the inconvenience!

  9. Slach commented on Mar 15, 2026

    @Slach
    Collaborator

    @bmassemin feel free to create separate issue if something will wrong with keeper in operator 0.26.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Keeper

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions