Skip to content

Conversation

@lilatomic
Copy link
Contributor

Description

Probes check that the response from ping is "PONG".

A ping command has exit code 0 even if the redis instance is loading and not returning responses. This means that a node could be marked as ready even if it was still loading.

Fixes #1567

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.
  • Documentation has been updated or added where necessary.

Additional Context

since we'll be using 2 commands in our script,
we want to exit early if the command fails

Signed-off-by: Daniel Goldman <[email protected]>
we'll be embedding this in a subcommand invocation,
so it's good to have it separated here

Signed-off-by: Daniel Goldman <[email protected]>
the redis-cli will return with an exit code of 0 even if the node is loading and not accepting connections
(responding with `LOADING Redis is loading the dataset in memory`).
`PONG` is returned only when the cluster is ready.
Checking for this return ensures that we only count redis nodes as available if they're actually accepting queries.

Signed-off-by: Daniel Goldman <[email protected]>
Signed-off-by: Daniel Goldman <[email protected]>
@lilatomic lilatomic changed the title Issue/1567 fix: check return of probes to ensure Redis is returning responses Dec 27, 2025
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@4ba0094). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/k8sutils/statefulset.go 77.77% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1626   +/-   ##
=======================================
  Coverage        ?   29.27%           
=======================================
  Files           ?       83           
  Lines           ?     6387           
  Branches        ?        0           
=======================================
  Hits            ?     1870           
  Misses          ?     4318           
  Partials        ?      199           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

readinessProbe should wait until Redis is accepting commands

1 participant