1. 30 Aug, 2012 2 commits
    • antirez's avatar
      Sentinel: Redis-side support for slave priority. · dfdbb227
      antirez authored
      A Redis slave can now be configured with a priority, that is an integer
      number that is shown in INFO output and can be get and set using the
      redis.conf file or the CONFIG GET/SET command.
      
      This field is used by Sentinel during slave election. A slave with lower
      priority is preferred. A slave with priority zero is never elected (and
      is considered to be impossible to elect even if it is the only slave
      available).
      
      A next commit will add support in the Sentinel side as well.
      dfdbb227
    • antirez's avatar
      run_id added to INFO output (backported from 2.6). · 96fbd433
      antirez authored
      This change is required to make Redis 2.4 compatible with Sentinel.
      
      The Run ID is a field that identifies a single execution of the Redis
      server. It can be useful for many purposes as it makes easy to detect if
      the instance we are talking about is the same, or if it is a different
      one or was rebooted. An application of run_id will be in the partial
      synchronization of replication, where a slave may request a partial sync
      from a given offset only if it is talking with the same master. Another
      application is in failover and monitoring scripts.
      96fbd433
  2. 09 Jul, 2012 1 commit
    • antirez's avatar
      REPLCONF internal command introduced. · b998ebe9
      antirez authored
      The REPLCONF command is an internal command (not designed to be directly
      used by normal clients) that allows a slave to set some replication
      related state in the master before issuing SYNC to start the
      replication.
      
      The initial motivation for this command, and the only reason currently
      it is used by the implementation, is to let the slave instance
      communicate its listening port to the slave, so that the master can
      show all the slaves with their listening ports in the "replication"
      section of the INFO output.
      
      This allows clients to auto discover and query all the slaves attached
      into a master.
      
      Currently only a single option of the REPLCONF command is supported, and
      it is called "listening-port", so the slave now starts the replication
      process with something like the following chat:
      
          REPLCONF listening-prot 6380
          SYNC
      
      Note that this works even if the master is an older version of Redis and
      does not understand REPLCONF, because the slave ignores the REPLCONF
      error.
      
      In the future REPLCONF can be used for partial replication and other
      replication related features where there is the need to exchange
      information between master and slave.
      
      NOTE: This commit also fixes a bug: the INFO outout already carried
      information about slaves, but the port was broken, and was obtained
      with getpeername(2), so it was actually just the ephemeral port used
      by the slave to connect to the master as a client.
      b998ebe9
  3. 12 May, 2012 1 commit
    • antirez's avatar
      More incremental active expired keys collection process. · 9419eb0f
      antirez authored
      If a large amonut of keys are all expiring about at the same time, the
      "active" expired keys collection cycle used to block as far as the
      percentage of already expired keys was >= 25% of the total population of
      keys with an expire set.
      
      This could block the server even for many seconds in order to reclaim
      memory ASAP. The new algorithm uses at max a small amount of
      milliseconds per cycle, even if this means reclaiming the memory less
      promptly it also means a more responsive server.
      9419eb0f
  4. 21 Apr, 2012 1 commit
    • antirez's avatar
      Limit memory used by big SLOWLOG entries. · df10c797
      antirez authored
      Two limits are added:
      
      1) Up to SLOWLOG_ENTRY_MAX_ARGV arguments are logged.
      2) Up to SLOWLOG_ENTRY_MAX_STRING bytes per argument are logged.
      3) slowlog-max-len is set to 128 by default (was 1024).
      
      The number of remaining arguments / bytes is logged in the entry
      so that the user can understand better the nature of the logged command.
      df10c797
  5. 29 Mar, 2012 2 commits
  6. 15 Feb, 2012 4 commits
    • antirez's avatar
    • antirez's avatar
      freeMemoryIfNeeded() minor refactoring · 35a4761f
      antirez authored
      35a4761f
    • antirez's avatar
      This fixes issue #327, is a very complex fix (unfortunately), details: · c63e1b83
      antirez authored
      1) sendReplyToClient() now no longer stops transferring data to a single
      client in the case we are out of memory (maxmemory-wise).
      
      2) in processCommand() the idea of we being out of memory is no longer
      the naive zmalloc_used_memory() > server.maxmemory. To say if we can
      accept or not write queries is up to the return value of
      freeMemoryIfNeeded(), that has full control about that.
      
      3) freeMemoryIfNeeded() now does its math without considering output
      buffers size. But at the same time it can't let the output buffers to
      put us too much outside the max memory limit, so at the same time it
      makes sure there is enough effort into delivering the output buffers to
      the slaves, calling the write handler directly.
      
      This three changes are the result of many tests, I found (partially
      empirically) that is the best way to address the problem, but maybe
      we'll find better solutions in the future.
      c63e1b83
    • antirez's avatar
      Initial version of c->reply_bytes implementation backported from unstable to... · 05755f5c
      antirez authored
      Initial version of c->reply_bytes implementation backported from unstable to 2.4, in order to apply issue 327 patches.
      05755f5c
  7. 02 Feb, 2012 1 commit
  8. 12 Jan, 2012 1 commit
  9. 07 Jan, 2012 2 commits
  10. 24 Nov, 2011 3 commits
  11. 21 Nov, 2011 2 commits
  12. 11 Nov, 2011 2 commits
  13. 18 Oct, 2011 2 commits
  14. 10 Oct, 2011 1 commit
  15. 19 Sep, 2011 2 commits
  16. 12 Jul, 2011 3 commits
  17. 01 Jul, 2011 2 commits
  18. 17 Jun, 2011 1 commit
  19. 14 Jun, 2011 1 commit
  20. 10 Jun, 2011 1 commit
  21. 08 Jun, 2011 1 commit
  22. 31 May, 2011 1 commit
  23. 30 May, 2011 1 commit
  24. 22 May, 2011 2 commits