Skip to content

[chart/redis-ha][Make per-pod announce Services headless to avoid Sentinel CPU loops after pod replacement] #422

Open

Description

@skyline75489

Describe the bug

The chart creates one ClusterIP announce Service per Redis/Valkey pod. Redis and Sentinel peers therefore connect through kube-proxy/conntrack instead of directly to pod IPs.

After replacing a pod, we observed a surviving Sentinel consume an entire CPU core indefinitely.

To Reproduce

  1. Install a three-node release with ClusterIP announce Services:
replicas: 3

sentinel:
  resolveHostnames: true
  announceHostnames: true
  1. Confirm each announce Service has a ClusterIP.
  2. Record baseline Sentinel CPU
  3. Repeatedly delete replica pods, waiting for recovery after each deletion:
for i in $(seq 1 50); do
  ordinal=$((i % 2 + 1))
  pod="<release>-server-${ordinal}"

  kubectl delete pod "$pod"
  kubectl wait --for=condition=Ready "pod/$pod" --timeout=10m
done
  1. Check Sentinel CPU after each replacement:
  2. When a Sentinel pins a core, attach strace to its process:
strace -f -p 1 -e trace=epoll_wait,recvfrom

Expected behavior

Sentinel should recover peer connectivity after pod replacement without entering a high-CPU event loop.

Actual behavior

A surviving Sentinel eventually consumes approximately one CPU core indefinitely.

The trace shows a tight event-loop cycle on a socket connected to a peer’s announce Service:

epoll_wait(... [{events=EPOLLERR, data=...}] ...) = 1
recvfrom(..., ...) = -1 EAGAIN

We observed approximately 193,000 epoll_wait and 194,000 recvfrom calls in 15 seconds.

This reproduced with both Valkey 8.0 and Redis 8.2 in Kubernetes, but not with equivalent local container churn.

Activity

  1. skyline75489 commented on Sep 17, 2026

    @skyline75489
    Author

    Proposed change

    Make per-pod announce Services headless:

    spec:
      clusterIP: None
      publishNotReadyAddresses: true

    Expose a compatibility option:

    announceServices:
      headless: true

    This makes announce hostnames resolve directly to their selected pod IPs.

    Validation

    With headless announce Services:

    • DNS resolved directly to replacement pod IPs.
    • Replication recovered to one primary and two replicas.
    • All Sentinels agreed on the topology.
    • Sentinel CPU remained around 8–10 millicores during repeated pod replacements.
    • The pinned-core condition did not recur.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions