Hello Tom,
currently there is no such guarantee, the suggested procedure is to use:
MULTI
CLIENT PAUSE <milliseconds>
ROLE
EXEC
To get the current offset, stop all the clients, wait for slaves to
reach the same offset (by calling ROLE in the slaves too).
When you are done you can kill the server.
However while the server is paused, you can't issue SHUTDOWN. You have
to kill the pid, or SHUTDOWN after it is available again after the
"pause" time.
What you can do is to sent the above transaction and SHUTDOWN
immediately after, so that it will be processed ASAP.
Why SHUTDOWN cannot ensure slaves are properly aligned? Because that
could take time, or slaves could be resynchronizing at the moment, or
disconnected for a netsplit or whatever, so SHUTDOWN is not a good way
to avoid race conditions during failovers. Sentinel manual failovers
can take care of this better. The same can do Redis Cluster that
performs the CLIENT PAUSE + offset check to slaves for you.
What SHUTDOWN could do that does not, is to at least try to write data
to the slave sockets if there is some room in the kernel buffers. This
look like a good idea but does not provide any guarantee at all, so
would be just an implementation improvement but semantically the same.
Regards,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
redis-db+u...@googlegroups.com.
> To post to this group, send email to
redi...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/redis-db.
> For more options, visit
https://groups.google.com/d/optout.
--
Salvatore 'antirez' Sanfilippo
open source developer - Redis Labs
https://redislabs.com
"If a system is to have conceptual integrity, someone must control the
concepts."
— Fred Brooks, "The Mythical Man-Month", 1975.