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

ScriptLoad call ForEachShard, slaves will return io timeout #3230

Open
Bensonzjy opened this issue Jan 15, 2025 · 4 comments
Open

ScriptLoad call ForEachShard, slaves will return io timeout #3230

Bensonzjy opened this issue Jan 15, 2025 · 4 comments
Assignees
Labels

Comments

@Bensonzjy
Copy link

why ScriptLoad call ForEachShard -> (masters, slaves), slaves readonly, aws redis oss return io timeout, call ForEachMaster better ?

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 27, 2025

@Bensonzjy thank you for reaching out. Could you please describe your problem, provide source code and version information?

@Bensonzjy
Copy link
Author

Bensonzjy commented Feb 27, 2025

go-redis version: v9.7.0
go.mod require: github.com/redis/go-redis/v9 v9.7.0
my code:
luaIncrSHA, err := clusterClient.ScriptLoad(ctx, luaIncrScript).Result()
return err != nil, err is io timeout, because exec load script on redis slave server

https://github.com/redis/go-redis/blob/v9.7.0/osscluster_commands.go#L35

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 27, 2025

@Bensonzjy have you checked https://redis.uptrace.dev/guide/go-redis.html#dial-tcp-i-o-timeout ? Are you able to connect to the slaves? In general, the error you are getting is not related to the script load command, but it is related to the client not being able to connect to the slave. Please check your network. Feel free to close this issue.

@ndyakov ndyakov self-assigned this Feb 27, 2025
@Bensonzjy
Copy link
Author

Bensonzjy commented Feb 28, 2025

my redis cluster info:
cluster info: cluster_state:ok cluster_slots_assigned:16384 cluster_slots_ok:16384 cluster_slots_pfail:0 cluster_slots_fail:0 cluster_known_nodes:2 cluster_size:1 cluster_current_epoch:0 cluster_my_epoch:0 cluster_stats_messages_sent:0 cluster_stats_messages_received:0 total_cluster_links_buffer_limit_exceeded:0

one master and other one slave, The ForEachShard method will traverse all nodes, including read-only slave nodes.

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

No branches or pull requests

2 participants