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

Why does lecttuce send lua script load command to all nodes (including replicas) in redis cluster? #2853

Closed
hungphan227 opened this issue May 14, 2024 · 4 comments

Comments

@hungphan227
Copy link

I tried scriptLoad method of Lecttuce with Redis cluster (3 master, 2 replicas, 1 replica down)

Expected: scriptLoad method run successfully

Actual: An error occurred that informed lecttuce could not connect to one node in the cluster

It seems that Lecttuce has to send the command to all the nodes in the redis cluster. If a replica node is down, the request would fail.

As I understand, Redis has a mechanism to replicate everything from master to replica. So why does lecttuce have to send lua script load command to all nodes (including replicas) in redis cluster?

@tishun
Copy link
Collaborator

tishun commented May 17, 2024

Hey @hungphan227 ,

this was already discussed in #720.

Could you go over the discussion there and let me know if you still have questions / concerns on the topic?

@tishun tishun added the status: waiting-for-feedback We need additional information before we can continue label May 17, 2024
@hungphan227
Copy link
Author

I have read #720 before but it did not explicitly explain why lecttuce has to send lua script load command to replicas. Isn't replicating lua script to replicas (from master) done by redis cluster itself?

@tishun
Copy link
Collaborator

tishun commented May 21, 2024

They are not replicated, as far as I know.

From the official documentation :

Although the server executes them, Eval scripts are regarded as a part of the client-side application, which is why they're not named, versioned, or persisted. So all scripts may need to be reloaded by the application at any time if missing (after a server restart, fail-over to a replica, etc.). As of version 7.0, Redis Functions offer an alternative approach to programmability which allow the server itself to be extended with additional programmed logic.

@hungphan227
Copy link
Author

Oh tks a lot :))

@tishun tishun removed the status: waiting-for-feedback We need additional information before we can continue label May 22, 2024
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

No branches or pull requests

2 participants