1. 24 Jul, 2012 4 commits
    • antirez's avatar
      Sentinel: debugging message removed. · d918e6f1
      antirez authored
      d918e6f1
    • antirez's avatar
      Sentinel: changes to connection handling and redirection. · 75fb6e5b
      antirez authored
      We disconnect the Redis instances hiredis link in a more robust way now.
      Also we change the way we perform the redirection for the +switch-master
      event, that is not just an instance reset with an address change.
      
      Using the same system we now implement the +redirect-to-master event
      that is triggered by an instance that is configured to be master but
      found to be a slave at the first INFO reply. In that case we monitor the
      master instead, logging the incident as an event.
      75fb6e5b
    • antirez's avatar
      Sentinel: check that instance still exists in reply callbacks. · 2179c269
      antirez authored
      We can't be sure the instance object still exists when the reply
      callback is called.
      2179c269
    • antirez's avatar
      Sentinel: more robust failover detection as observer. · d876d6fe
      antirez authored
      Sentinel observers detect failover checking if a slave attached to the
      monitored master turns into its replication state from slave to master.
      However while this change may in theory only happen after a SLAVEOF NO
      ONE command, in practie it is very easy to reboot a slave instance with
      a wrong configuration that turns it into a master, especially if it was
      a past master before a successfull failover.
      
      This commit changes the detection policy so that if an instance goes
      from slave to master, but at the same time the runid has changed, we
      sense a reboot, and in that case we don't detect a failover at all.
      
      This commit also introduces the "reboot" sentinel event, that is logged
      at "warning" level (so this will trigger an admin notification).
      
      The commit also fixes a problem in the disconnect handler that assumed
      that the instance object always existed, that is not the case. Now we
      no longer assume that redisAsyncFree() will call the disconnection
      handler before returning.
      d876d6fe
  2. 23 Jul, 2012 1 commit