Skip to content

Conversation

@carodewig
Copy link
Contributor

@carodewig carodewig commented Nov 24, 2025

Per fred, replicas are only supported with clustered Redis (not standalone or sentinel).

In the current codebase, when fred connects to a high-availability Redis instance in GCP, it detects the presence of a replica and attempts to connect to it. However the replica is not guaranteed to be reachable, and if it's not (like in the default high-availability setup), the client will error and reconnect repeatedly.

As far as I can tell, there's no way to disable the attempted replica connection - it will occur when the cfg(replicas) feature is enabled. Fixing the errors requires two changes:

  1. replica queries are removed from all non-cluster Redis calls (change originally made in fix: don't use replicas against standalone Redis instance #8656).
  2. lazy_connections is only set to false when the Redis instance is a cluster. This way, when fred detects a replica on a non-cluster instance, it won't attempt to connect to it immediately, triggering the error.

NB: fred does see the high-availability Redis instance as a Centralized (aka standalone) instance, so determining whether the instance is a cluster can still happen via client_config.server.is_clustered().


Because of the specifics of how to encounter this issue, I haven't added any tests - just tested manually with RTF (see PR88 in the morgue).

No amendments to the Redis replicas changeset, as that already called out 'clustered' Redis specifically (not sentinel).


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@github-actions
Copy link
Contributor

@carodewig, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@carodewig carodewig force-pushed the caroline/fix-gcp-redis branch from 1b0a428 to 91387a9 Compare November 24, 2025 20:37
@apollo-librarian
Copy link

apollo-librarian bot commented Nov 24, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 3442318b879fcdf40b90b87e
Build Logs: View logs

@carodewig carodewig force-pushed the caroline/fix-gcp-redis branch from 91387a9 to cd35e99 Compare November 24, 2025 20:39
@carodewig carodewig marked this pull request as ready for review November 24, 2025 21:15
@carodewig carodewig requested a review from a team as a code owner November 24, 2025 21:15
@carodewig
Copy link
Contributor Author

FYI: this PR musg be true-merged to avoid conflicts due to the cherry-picked commit.

Copy link
Contributor

@bnjjj bnjjj left a comment

Choose a reason for hiding this comment

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

That sounds painful...

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.

3 participants