Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 4c573836b916a52b3f2ac928 |
This comment has been minimized.
This comment has been minimized.
This reverts commit 96463c1.
| .inner | ||
| .set::<(), _, _>(key, value, expiration, None, false) | ||
|
|
||
| // NOTE: we need a writer, so don't use replicas() here |
There was a problem hiding this comment.
What happens if we used .replicas() here ? is it typesafe or would we have an error ?
There was a problem hiding this comment.
We would get a Redis error during runtime, it would still compile
There was a problem hiding this comment.
It might be worth adding a monitor on our dashboards to detect that kind of behavior because it would be really critical. What do you think ?
There was a problem hiding this comment.
Added! Manually created the alert for now, will codify it in Terraform next week after making sure it's not too flaky
aaronArinder
left a comment
There was a problem hiding this comment.
I think this all makes sense; but, it's probably worth getting a second opinion too just in case; one thing that worries me (and that we haven't tested, I don't think?) is what happens when a node gets kicked out of the cluster. Do we handle MOVEDs/redirection correctly? I assume so, but who knows!
| }; | ||
|
|
||
| // PR-8405: must not use lazy connections or else commands will queue rather than being sent | ||
| config.replica.lazy_connections = false; |
There was a problem hiding this comment.
better safe than sorry!
| } | ||
|
|
||
| // Backwords compatibility with old redis client | ||
| // Backwards compatibility with old redis client |
There was a problem hiding this comment.
| // Backwards compatibility with old redis client | |
| // Backwoods compatibility with old redis client |
@aaronArinder This should work just fine! We've tested this in the internal router (although with |
This reverts commit 3b5d2ed.
Sends commands to Redis read replicas when (a) the command is read-only and (b) Redis is running in clustered mode.
Changes include:
The changes apply to all Redis caches, including entity, response, and query plan caches.
NB: enabling this required me to turn lazy connections off. When enabled, the Redis commands would queue in memory rather than ever being sent to a node. RTF comparison dashboard below, using gcloud memorystore - the first round of queries had lazy connections off, the second had them on:

Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
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. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩