Skip to content

Breaks when any of the node in the list goes down #21

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

Open
15astro opened this issue Aug 31, 2018 · 2 comments
Open

Breaks when any of the node in the list goes down #21

15astro opened this issue Aug 31, 2018 · 2 comments

Comments

@15astro
Copy link

15astro commented Aug 31, 2018

require "redis_cluster"
rs = RedisCluster.new([{host: '10.x.x.1', port: 9000}, {host: '10.x.x.2', port: 8000},{host: '10.x.x.2', port: 7000},{host: '10.x.x.3', port: 8000}, {host: '10.x.x.2', port: 7000}, {host: '10.x.x.3', port: 9000}])
i=0
rs.pipelined do
    while i < 100000000 do
    rs.set "b", i
    i +=1
   end
end

I have above code snippet running, but when 10.0.0.1:7000 master in cluster goes down, it simply break, does not insert data in new master

/usr/local/rvm/gems/ruby-2.5.1/gems/redis-3.3.5/lib/redis/client.rb:121:in call': MOVED 3300 10.0.0.1:7000 (Redis::CommandError)`

redis_cluster (0.3.2)
redis version: 4.0.11

@zhchsf
Copy link
Owner

zhchsf commented Sep 4, 2018

It depend on health of redis clusters. When one master node goes down, redis clusters will be in self recovery. It maybe some error to execute command. After recovery completed, it will be fine to execute command.

@15astro
Copy link
Author

15astro commented Sep 6, 2018

@zhchsf,
The new master is elected in less than a second. How can reconnection be tried in this case to connect to the newly elected master instead of breaking code?

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