It is unclear to me from the documentation on replication whether the SYNC command is blocking.
It seems like it shouldn't be (after all, spinning up a new slave would stop the master from serving requests), but I'd like confirmation of that.
For context, I'm looking at adding a slave to a master hosting about 8GB of data with no disk sync*.
*Historically, data loss has not been a concern. We're changing that, so replication and persistence are being "back ported" to a degree.
The Redis replication uses an asynchronous method to transfer data from master to slave. The slave periodically acknowledges the received data sent by the master node, and also the master node can have many slaves. Redis can support cascading replication, so the slave can be connected to another slave.
Automatic failover. If a master is not working as expected, Sentinel can start a failover process where a slave is promoted to master, the other additional slaves are reconfigured to use the new master, and the applications using the Redis server informed about the new address to use when connecting.
Redis Master does replicate writes to one or more Redis Slaves. The master-slave replication is done asynchronously.
the master will just perform a BGSAVE on SYNC request from the slave, so it's not a blocking operation.
So the sequence is:
It also works if the master is not configured to save, simply it will produce an .rdb just for master <-> slave synchronization. In master instances configured without "save" lines in redis.conf BGSAVE is not called automatically, but can still be called by the user if there is the need to save an .rdb file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With