• antirez's avatar
    Cluster: new clusterDoBeforeSleep() API. · 7afc0dd5
    antirez authored
    The new API is able to remember operations to perform before returning
    to the event loop, such as checking if there is the failover quorum for
    a slave, save and fsync the configuraiton file, and so forth.
    
    Because this operations are performed before returning on the event
    loop we are sure that messages that are sent in the same event loop run
    will be delivered *after* the configuration is already saved, that is a
    requirement sometimes. For instance we want to publish a new epoch only
    when it is already stored in nodes.conf in order to avoid returning back
    in the logical clock when a node is restarted.
    
    This new API provides a big performance advantage compared to saving and
    possibly fsyncing the configuration file multiple times in the same
    event loop run, especially in the case of big clusters with tens or
    hundreds of nodes.
    7afc0dd5
redis.h 68.3 KB