1. 04 May, 2015 1 commit
    • antirez's avatar
      Sentinel: remove useless sentinelFlushConfig() call · 99c93f34
      antirez authored
      To rewrite the config in the loop that adds slaves back after a master
      reset, in order to handle switching to another master, is useless: it
      just adds latency since there is an fsync call in the inner loop,
      without providing any additional guarantee, but the contrary, since if
      after the first loop iteration the server crashes we end with just a
      single slave entry losing all the other informations.
      
      It is wiser to rewrite the config at the end when the full new
      state is configured.
      99c93f34
  2. 28 Apr, 2015 1 commit
  3. 02 Feb, 2015 1 commit
    • Leandro López (inkel)'s avatar
      Support CLIENT commands in Redis Sentinel · d5e01519
      Leandro López (inkel) authored
      When trying to debug sentinel connections or max connections errors it
      would be very useful to have the ability to see the list of connected
      clients to a running sentinel. At the same time it would be very helpful
      to be able to name each sentinel connection or kill offending clients.
      
      This commits adds the already defined CLIENT commands back to Redis
      Sentinel.
      d5e01519
  4. 23 Dec, 2014 3 commits
  5. 11 Dec, 2014 4 commits
    • antirez's avatar
      sdsformatip() removed. · bbf0736c
      antirez authored
      Specialized single-use function. Not the best match for sds.c btw.
      Also genClientPeerId() is no longer static: we need symbols.
      bbf0736c
    • antirez's avatar
      AnetFormatIP(): renamed, commented, now sticks to IP:port format. · ce269ad3
      antirez authored
      A few code style changes + consistent format: not nice for humans but
      better for parsers.
      ce269ad3
    • Matt Stancliff's avatar
      Sentinel: Improve INFO command behavior · 391fc9b6
      Matt Stancliff authored
      Improvements:
        - Return empty string if asking for non-existing section (INFO foo)
        - Fix potential memory leak (caused by sdsempty() then returned if >2 args)
        - Clean up argument parsing
        - Allow "all" as valid section (same as "default" or zero args currently)
        - Move strcasecmp to end of evaluation chain in conditionals
      
      Also, since we're C99, I moved some variable declarations to be closer
      to where they are actually used (saves us from needing to free an empty info
      if detect argument errors up front).
      
      Closes #1915
      Closes #1966
      391fc9b6
    • Matt Stancliff's avatar
      Cleanup all IP formatting code · 491881e1
      Matt Stancliff authored
      Instead of manually checking for strchr(n,':') everywhere,
      we can use our new centralized IP formatting functions.
      491881e1
  6. 10 Dec, 2014 4 commits
  7. 20 Nov, 2014 2 commits
    • Matt Stancliff's avatar
      Add SENTINEL INFO-CACHE [masters...] · f8c73e38
      Matt Stancliff authored
      Sentinel queries the INFO from every master and from every replica of
      every master.
      
      We can cache the INFO results in Sentinel so Sentinel can be a single
      place to quickly get all INFO output for an entire Sentinel monitoring
      group.
      
      This commit gives us SENTINEL INFO-CACHE in two forms:
        - SENTINEL INFO-CACHE — returns all masters and all replicas
        - SENTINEL INFO-CACHE master0 master1 ... masterN — vararg specify masters
      
      Results are returned as a multibulk reply with two top-level entries
      for each master.  The first entry for each master is the name of the master.
      The second entry is a nested multibulk reply with the contents of INFO,
      first for the master, then an additional entry for each of the
      replicas.
      f8c73e38
    • Matt Stancliff's avatar
      Sentinel: Add initial quorum bounds check · 6739ef44
      Matt Stancliff authored
      Fixes #2054
      6739ef44
  8. 29 Sep, 2014 1 commit
    • Matt Stancliff's avatar
      Clean up text throughout project · 12d0195b
      Matt Stancliff authored
        - Remove trailing newlines from redis.conf
        - Fix comment misspelling
        - Clarifies zipEncodeLength usage and a C API mention (#1243, #1242)
        - Fix cluster typos (inspired by @papanikge #1507)
        - Fix rewite -> rewrite in a few places (inspired by #682)
      
      Closes #1243, #1242, #1507
      12d0195b
  9. 11 Sep, 2014 2 commits
    • antirez's avatar
      f5efa9bb
    • antirez's avatar
      Sentinel: fix computation of total number of votes. · f4be6f16
      antirez authored
      The code to check the number of voters was never updated to follow the new
      Sentinel specification, so the number of voters was computed using only
      the set of Sentinels that provided a vote.
      
      This means that there is a changing majority on partitions, even if
      usually the issue is not triggered because of the configured quorum
      check (what was broken was the other implicit check that requires anyway
      half of the known sentinels to agree in order to start a failover).
      f4be6f16
  10. 04 Sep, 2014 3 commits
  11. 01 Sep, 2014 1 commit
  12. 25 Aug, 2014 2 commits
  13. 13 Aug, 2014 1 commit
  14. 23 Jun, 2014 2 commits
  15. 19 Jun, 2014 2 commits
    • antirez's avatar
      Sentinel: send hello messages ASAP after config change. · 41f12ac9
      antirez authored
      Eventual configuration convergence is guaranteed by our periodic hello
      messages to all the instances, however when there are important notices
      to share, better make a phone call. With this commit we force an hello
      message to other Sentinal and Redis instances within the next 100
      milliseconds of a config update, which is practically better than
      waiting a few seconds.
      41f12ac9
    • antirez's avatar
      Sentinel: handle SRI_PROMOTED flag correctly. · 94bc4673
      antirez authored
      Lack of check of the SRI_PROMOTED flag caused Sentienl to act with the
      promoted slave turned into a master during failover like if it was a
      normal instance.
      
      Normally this problem was not apparent because during real failovers the
      old master is down so the bugged code path was not entered, however with
      manual failovers via the SENTINEL FAILOVER command, the problem was
      easily triggered.
      
      This commit prevents promoted slaves from getting reconfigured, moreover
      we now explicitly check that during a failover the slave turning into a
      master is the one we selected for promotion and not a different one.
      94bc4673
  16. 17 Jun, 2014 1 commit
    • antirez's avatar
      Sentinel: send SLAVEOF with MULTI, CLIENT KILL, CONFIG REWRITE. · 2c175912
      antirez authored
      This implements the new Sentinel-Client protocol for the Sentinel part:
      now instances are reconfigured using a transaction that ensures that the
      config is rewritten in the target instance, and that clients lose the
      connection with the instance, in order to be forced to: ask Sentinel,
      reconnect to the instance, and verify the instance role with the new
      ROLE command.
      2c175912
  17. 28 May, 2014 1 commit
  18. 20 May, 2014 1 commit
  19. 08 May, 2014 2 commits
    • antirez's avatar
      Sentinel: log when a failover will be attempted again. · 21027786
      antirez authored
      When a Sentinel performs a failover (successful or not), or when a
      Sentinel votes for a different Sentinel trying to start a failover, it
      sets a min delay before it will try to get elected for a failover.
      
      While not strictly needed, because if multiple Sentinels will try
      to failover the same master at the same time, only one configuration
      will eventually win, this serialization is practically very useful.
      Normal failovers are cleaner: one Sentinel starts to failover, the
      others update their config when the Sentinel performing the failover
      is able to get the selected slave to move from the role of slave to the
      one of master.
      
      However currently this timeout was implicit, so users could see
      Sentinels not reacting, after a failed failover, for some time, without
      giving any feedback in the logs to the poor sysadmin waiting for clues.
      
      This commit makes Sentinels more verbose about the delay: when a master
      is down and a failover attempt is not performed because the delay has
      still not elaped, something like that will be logged:
      
          Next failover delay: I will not start a failover
          before Thu May  8 16:48:59 2014
      21027786
    • antirez's avatar
      Sentinel: generate +config-update-from event when a new config is received. · 931beae9
      antirez authored
      This event makes clear, before the switch-master event is generated,
      that a Sentinel received a configuration update from another Sentinel.
      931beae9
  20. 24 Mar, 2014 2 commits
  21. 18 Mar, 2014 3 commits