Skip to content
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

Make CLUSTER SETSLOT ... TIMEOUT 0 bypass the wait #422

Open
zuiderkwast opened this issue May 2, 2024 · 6 comments
Open

Make CLUSTER SETSLOT ... TIMEOUT 0 bypass the wait #422

zuiderkwast opened this issue May 2, 2024 · 6 comments

Comments

@zuiderkwast
Copy link
Contributor

Follow-up of #245.

TIMEOUT 0 is interpreted as the default value (2 seconds?) which is counter-intuitive given that TIMEOUT 1 is 1ms.

It's better that TIMEOUT 0 bypasses replication-before-execution.

@madolson wrote

If a node is disconnected might be a valid use case? If a replica is unavailable for some reason, you might still want this to through. Maybe you're trying to move the data from an unhealthy to a healthy shard by migrating the data.

Original discussion: #245 (comment)_

@madolson
Copy link
Member

madolson commented May 3, 2024

TIMEOUT 0 normally means infinite, so it also seems a bit weird that TIMEOUT 0 might mean disable the feature.

@vinigracindo
Copy link

Maybe it would be better to validate the value. Just as it would be counter-intuitive for a value of zero to default to 2, wouldn't it be counter-intuitive for a value of 0 to disable the feature?

@zuiderkwast
Copy link
Contributor Author

I think it is intuitive that TIMEOUT 0 means don't wait at all. (That's what disable the feature means.)

@zuiderkwast
Copy link
Contributor Author

@madolson you argued that there might be uses cases for disabling the feature. What other syntax would you suggest for that, if not TIMEOUT 0? I don't think there's any use case for infinite wait.

@madolson
Copy link
Member

The only other option I would consider is -1, but I suppose I don't feel all that strongly. I'm okay with either option.

@zuiderkwast
Copy link
Contributor Author

zuiderkwast commented May 14, 2024

-1 = infinity then? ;)

sleep(0) returns immediately, as an example of 0 meaning don't wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants