tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

Querying slave

Open justewg opened this issue 6 years ago • 1 comments

I want to make master-slave replica, where master will manage new data inserts, and slave -- requests from site. I've start 2 servers, run at one of it command FOLLOW . Now I see by command stats, that records, being inserted at master, follows to slave. But when I try to query slave replica, I received only '(error) catching up to leader'. What am I doing wrong? master server: 127.0.0.1:9851> SET test test1 POINT 33 57 {"ok":true,"elapsed":"204.49335ms"} 127.0.0.1:9851> SCAN test {"ok":true,"objects":[{"id":"test1","object":{"type":"Point","coordinates":[57,33]}}],"count":1,"cursor":0,"elapsed":"23.252424ms"} 127.0.0.1:9851> slave server: 127.0.0.1:9851> SCAN test (error) catching up to leader 127.0.0.1:9851> GET test test1 (error) catching up to leader 127.0.0.1:9851> info (error) catching up to leader 127.0.0.1:9851>

justewg avatar Jul 24 '19 11:07 justewg

You are not doing anything wrong.

catching up to leader means that the follower only has a partial dataset and is in the process of downloading the remaining data from the leader.

The solution is to wait a little longer and try again, or request the data from the leader.

The amount of time it takes to catch up depends on the size of the leader's dataset.

tidwall avatar Jul 30 '19 02:07 tidwall