Skip to content

fix: skip unreachable RedisReplication pods during role discovery - #1843

Open
leeworker wants to merge 1 commit into
OT-CONTAINER-KIT:mainfrom
leeworker:fix/redisreplication-skip-unreachable-pods
Open

fix: skip unreachable RedisReplication pods during role discovery#1843
leeworker wants to merge 1 commit into
OT-CONTAINER-KIT:mainfrom
leeworker:fix/redisreplication-skip-unreachable-pods

Conversation

@leeworker

Copy link
Copy Markdown

Fixes #1842

Summary

When a worker node crashes, Redis pods can remain Running/Ready with stale Kubernetes status while Redis is unreachable. GetRedisNodesByRole previously fail-fast on the first probe error, which blocked the entire RedisReplication reconcile loop and prevented healthy pods from updating status.masterNode and redis-role labels.

This change:

  • Skips per-pod Redis probe failures in GetRedisNodesByRole (log + continue) instead of aborting reconcile
  • Removes stale redis-role labels from pods that are probeable in Kubernetes but unreachable over Redis, so master Services do not keep routing to dead pods during the stale-Ready window

Test plan

  • go test ./internal/k8sutils/... -run 'GetRedisNodesByRole|IsRedisPodProbeable'
  • go test ./internal/controller/common/redis/... -run UpdateRedisRoleLabel
  • go test ./internal/controller/redisreplication/... -run 'TestReconcile'

Made with Cursor

When a node crashes, pods can remain Running/Ready with stale status while
Redis is unreachable. Fail-fast role probing blocked reconcile and prevented
healthy pods from updating status and redis-role labels.

Continue on per-pod probe failures in GetRedisNodesByRole and remove stale
redis-role labels when UpdateRedisRoleLabel cannot reach a pod.

Fixes OT-CONTAINER-KIT#1842

Signed-off-by: lixianzhu <lixianzhu@lixianzhudeMacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
@leeworker

Copy link
Copy Markdown
Author

Hi maintainers,

Could you please approve the workflows when you have a chance?

This PR fixes #1842: when a worker node crashes, Redis pods can remain Running/Ready with stale status while Redis is unreachable. GetRedisNodesByRole previously fail-fast on the first probe error and blocked the whole RedisReplication reconcile loop, so healthy pods could not update status.masterNode or redis-role labels.

Thanks!

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.

RedisReplication: node crash leaves pod Running/Ready (stale) — GetRedisNodesByRole fail-fast blocks role label and status updates

1 participant