• Guillem Jover's avatar
    Send the readiness notification when we are ready to accept connections (#8409) · 3a5905fa
    Guillem Jover authored
    On a replica we do accept connections, even though commands accessing
    the database will operate in read-only mode. But the server is still
    already operational and processing commands.
    
    Not sending the readiness notification means that on a HA setup where
    the nodes all start as replicas (with replicaof in the config) with
    a replica that cannot connect to the master server and which might not
    come back in a predictable amount of time or at all, the service
    supervisor will end up timing out the service and terminating it, with
    no option to promote it to be the main instance. This seems counter to
    what the readiness notification is supposed to be signaling.
    
    Instead send the readiness notification when we start accepting
    commands, and then send the various server status changes as that.
    
    Fixes: commit 641c64ad
    Fixes: commit dfb598cf
    3a5905fa
replication.c 149 KB