Skip to content

Fix cluster-slots discover race condition again #2867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

jjsimps
Copy link
Contributor

@jjsimps jjsimps commented Nov 18, 2024

Description

This re-applies the fix done in #2731, as noted by @edwin-jones.

See #2704 for details.


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

try {
const addressesInUse = new Set<string>(),
promises: Array<Promise<unknown>> = [],
eagerConnect = this.#options.minimizeConnections !== true;

for (const { from, to, master, replicas } of await this.#getShards(rootNode)) {
const shards = await this.#getShards(rootNode);
this.#resetSlots(); // Reset slots AFTER shards have been fetched to prevent a race condition

Choose a reason for hiding this comment

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

This regressed when b2d35c5 landed.

Is it possible to add a test to prevent further regressions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I dont see an easy way to test it..
I'll merge the PR as is for now, and we can add the test in another PR.. :)

@leibale
Copy link
Contributor

leibale commented Nov 25, 2024

Sorry about it.. I'm not sure what happened, but I'll need to make sure that we did not lose more work..
BTW, the latest non "next" release still contains this fix

@leibale leibale merged commit ffa7d25 into redis:master Nov 25, 2024
@jjsimps jjsimps deleted the fix-slots branch November 25, 2024 21:16
@gruppferi
Copy link

gruppferi commented Dec 6, 2024

Hi we are really blocked by this for AWS Redis migration any luck that it get released?
Thanks

@stondini
Copy link

stondini commented Mar 4, 2025

Hello,

Does someone know when a new version including this fix will be released ?
There are more than 40 commits ([email protected]) waiting :)

Many thanks
Stephane

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.

5 participants