Replication and promotion

137 views
Skip to first unread message

Mario

unread,
Dec 27, 2021, 12:15:34 PM12/27/21
to Kvrocks
Hello everyone!

We're doing some tests with kvrocks and I'm checking the replication capabilities.

I have two instances, one is the primary and another one is the replica connected with the slaveof command but now I'm checking on how to promotion the replica to primary in case the primary fails and I cannot find a way to do it or to remove the slave flag from it.

Can you tell me more about that or point me to the documentation? I've read the replication design wiki page but I cannot find nothing related to that.

Thank you

Andrew Shooter

unread,
Dec 28, 2021, 9:57:01 AM12/28/21
to Kvrocks
Hi,
    Kvrocks is compatible with Redis. You can use "slaveof" command to change role, so you can execute "slaveof no one" on replica for changing it into primary role, and "slaveof $ip $port" command could make primary into replica. Of course, you can use "redis sentinel" to manage to failover automatically.

Cheers

Mario

unread,
Dec 29, 2021, 7:46:21 AM12/29/21
to Kvrocks
Thank you very much people! We're setting sentinel so we can test failover :)

Another question, related to the usage of Sentinel, is it possible to define or use:

min-replicas-to-write 3
min-replicas-max-lag 10

settings? Those are from redis but I dunno if it's possible to use them to avoid the network partition problem of having 2 masters.

Andrew Shooter

unread,
Dec 30, 2021, 1:34:11 AM12/30/21
to Kvrocks
Hi,
    Currently, we don't support these config in Kvrocks, but we have a plan to optimize replication implementation of kvrocks in our project 3.0 (https://github.com/KvrocksLabs/kvrocks/projects/2), i think we can try to support these features in future, let me open an issue https://github.com/KvrocksLabs/kvrocks/issues/439

Mario

unread,
Jan 19, 2022, 2:44:12 PM1/19/22
to Kvrocks
Thank you wangyu, that would be very helpful :)

I have another question, is there a way to know when a replica is 100% synchronized / up-to-date with the main? My question comes from knowing when you add a new replica or you want to do a manual failover we want to know if the replicas that are going to receive the master are fully synchronize

Thank you :)

Andrew Shooter

unread,
Jan 25, 2022, 8:27:35 PM1/25/22
to Mario, Kvrocks
It is easy to  to know a replica is 100% up-to-date with the primary, just like redis, you compare primary 'master_repl_offset' and replica 'slave_repl_offset'   from thier INFO command output, if they are equal, this says 100% synchronization between primary with replica.

'Mario' via Kvrocks <kvr...@googlegroups.com> 于2022年1月20日周四 03:44写道:
--
You received this message because you are subscribed to the Google Groups "Kvrocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kvrocks+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kvrocks/2b88e426-cc3a-4c93-86ec-841feccb4a74n%40googlegroups.com.

Mario

unread,
Feb 15, 2022, 9:31:23 AM2/15/22
to Kvrocks
Thank you very much wangyu!
Reply all
Reply to author
Forward
0 new messages