1. 26 Jun, 2014 2 commits
    • Matt Stancliff's avatar
      Cluster: Add CLUSTER SLOTS command · 237188bf
      Matt Stancliff authored
      CLUSTER SLOTS returns a Redis-formatted mapping from
      slot ranges to IP/Port pairs serving that slot range.
      
      The outer return elements group return values by slot ranges.
      
      The first two entires in each result are the min and max slots for the range.
      
      The third entry in each result is guaranteed to be either
      an IP/Port of the master for that slot range - OR - null
      if that slot range, for some reason, has no master
      
      The 4th and higher entries in each result are replica instances
      for the slot range.
      
      Output comparison:
      127.0.0.1:7001> cluster nodes
      f853501ec8ae1618df0e0f0e86fd7abcfca36207 127.0.0.1:7001 myself,master - 0 0 2 connected 4096-8191
      5a2caa782042187277647661ffc5da739b3e0805 127.0.0.1:7005 slave f853501ec8ae1618df0e0f0e86fd7abcfca36207 0 1402622415859 6 connected
      6c70b49813e2ffc9dd4b8ec1e108276566fcf59f 127.0.0.1:7007 slave 26f4729ca0a5a992822667fc16b5220b13368f32 0 1402622415357 8 connected
      2bd5a0e3bb7afb2b56a2120d3fef2f2e4333de1d 127.0.0.1:7006 slave 32adf4b8474fdc938189dba00dc8ed60ce635b0f 0 1402622419373 7 connected
      5a9450e8279df36ff8e6bb1c139ce4d5268d1390 127.0.0.1:7000 master - 0 1402622418872 1 connected 0-4095
      32adf4b8474fdc938189dba00dc8ed60ce635b0f 127.0.0.1:7002 master - 0 1402622419874 3 connected 8192-12287
      5db7d05c245267afdfe48c83e7de899348d2bdb6 127.0.0.1:7004 slave 5a9450e8279df36ff8e6bb1c139ce4d5268d1390 0 1402622417867 5 connected
      26f4729ca0a5a992822667fc16b5220b13368f32 127.0.0.1:7003 master - 0 1402622420877 4 connected 12288-16383
      
      127.0.0.1:7001> cluster slots
      1) 1) (integer) 0
         2) (integer) 4095
         3) 1) "127.0.0.1"
            2) (integer) 7000
         4) 1) "127.0.0.1"
            2) (integer) 7004
      2) 1) (integer) 12288
         2) (integer) 16383
         3) 1) "127.0.0.1"
            2) (integer) 7003
         4) 1) "127.0.0.1"
            2) (integer) 7007
      3) 1) (integer) 4096
         2) (integer) 8191
         3) 1) "127.0.0.1"
            2) (integer) 7001
         4) 1) "127.0.0.1"
            2) (integer) 7005
      4) 1) (integer) 8192
         2) (integer) 12287
         3) 1) "127.0.0.1"
            2) (integer) 7002
         4) 1) "127.0.0.1"
            2) (integer) 7006
      237188bf
    • antirez's avatar
      Cluster: myself->ip autodiscovery. · 8fdc857a
      antirez authored
      Instead of having an hardcoded IP address in the node configuration, we
      autodiscover it via MEET messages for automatic update when the node is
      restarted with a different IP address.
      
      This mechanism was discussed in the context of PR #1782.
      8fdc857a
  2. 24 Jun, 2014 1 commit
  3. 23 Jun, 2014 10 commits
  4. 21 Jun, 2014 27 commits
    • antirez's avatar
      Allow to call ROLE in LOADING state. · 82caeee1
      antirez authored
      82caeee1
    • antirez's avatar
      ROLE command: array len fixed for slave output. · 96f556b2
      antirez authored
      96f556b2
    • antirez's avatar
      Jemalloc updated to 3.6.0. · 5c988b33
      antirez authored
      Not a single bug in about 3 months, and our previous version was
      too old (3.2.0).
      5c988b33
    • antirez's avatar
      Jemalloc update script added. · f94d46ba
      antirez authored
      f94d46ba
    • antirez's avatar
      9eb02c6a
    • antirez's avatar
      52456bf8
    • antirez's avatar
    • antirez's avatar
      Sentinel: send hello messages ASAP after config change. · 54756adf
      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.
      54756adf
    • antirez's avatar
      Sentinel test: add manual failover test. · 32adcda8
      antirez authored
      32adcda8
    • antirez's avatar
      Sentinel: handle SRI_PROMOTED flag correctly. · 6588ef29
      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.
      6588ef29
    • antirez's avatar
      64e618d1
    • antirez's avatar
    • antirez's avatar
      3cba0c3e
    • antirez's avatar
      Test: tcl client, unset deferred var on close. · 256046fd
      antirez authored
      256046fd
    • Matt Stancliff's avatar
      Add correct exit value to failed tests · 4dfc1859
      Matt Stancliff authored
      4dfc1859
    • Alex Suraci's avatar
      add missing signal.h include · 2b1047ff
      Alex Suraci authored
      2b1047ff
    • Matt Stancliff's avatar
      Add SIGINT handler to cli --intrinsic-latency · 65bab611
      Matt Stancliff authored
      If we run a long latency session and want to Ctrl-C out of it,
      it's nice to still get the summary output at the end.
      65bab611
    • antirez's avatar
      Sentinel: send SLAVEOF with MULTI, CLIENT KILL, CONFIG REWRITE. · 8d75a20a
      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.
      8d75a20a
    • antirez's avatar
      CLIENT KILL API modified. · 52f1edb2
      antirez authored
      Added a new SKIPME option that is true by default, that prevents the
      client sending the command to be killed, unless SKIPME NO is sent.
      52f1edb2
    • antirez's avatar
      7e986363
    • antirez's avatar
      New features for CLIENT KILL. · ca262a58
      antirez authored
      ca262a58
    • antirez's avatar
      Assign an unique non-repeating ID to each new client. · b7dd4518
      antirez authored
      This will be used by CLIENT KILL and is also a good way to ensure a
      given client is still the same across CLIENT LIST calls.
      
      The output of CLIENT LIST was modified to include the new ID, but this
      change is considered to be backward compatible as the API does not imply
      you can do positional parsing, since each filed as a different name.
      b7dd4518
    • antirez's avatar
      Client types generalized. · d97d1a64
      antirez authored
      Because of output buffer limits Redis internals had this idea of type of
      clients: normal, pubsub, slave. It is possible to set different output
      buffer limits for the three kinds of clients.
      
      However all the macros and API were named after output buffer limit
      classes, while the idea of a client type is a generic one that can be
      reused.
      
      This commit does two things:
      
      1) Rename the API and defines with more general names.
      2) Change the class of clients executing the MONITOR command from "slave"
         to "normal".
      
      "2" is a good idea because you want to have very special settings for
      slaves, that are not a good idea for MONITOR clients that are instead
      normal clients even if they are conceptually slave-alike (since it is a
      push protocol).
      
      The backward-compatibility breakage resulting from "2" is considered to
      be minimal to care, since MONITOR is a debugging command, and because
      anyway this change is not going to break the format or the behavior, but
      just when a connection is closed on big output buffer issues.
      d97d1a64
    • antirez's avatar
      Scripting: regression test for issue #1811. · 59cfa49c
      antirez authored
      59cfa49c
    • antirez's avatar
      Fix semantics of Lua calls to SELECT. · 2b57d96e
      antirez authored
      Lua scripts are executed in the context of the currently selected
      database (as selected by the caller of the script).
      
      However Lua scripts are also free to use the SELECT command in order to
      affect other DBs. When SELECT is called frm Lua, the old behavior, before
      this commit, was to automatically set the Lua caller selected DB to the
      last DB selected by Lua. See for example the following sequence of
      commands:
      
          SELECT 0
          SET x 10
          EVAL "redis.call('select','1')" 0
          SET x 20
      
      Before this commit after the execution of this sequence of commands,
      we'll have x=10 in DB 0, and x=20 in DB 1.
      
      Because of the problem above, there was a bug affecting replication of
      Lua scripts, because of the actual implementation of replication. It was
      possible to fix the implementation of Lua scripts in order to fix the
      issue, but looking closely, the bug is the consequence of the behavior
      of Lua ability to set the caller's DB.
      
      Under the old semantics, a script selecting a different DB, has no simple
      ways to restore the state and select back the previously selected DB.
      Moreover the script auhtor must remember that the restore is needed,
      otherwise the new commands executed by the caller, will be executed in
      the context of a different DB.
      
      So this commit fixes both the replication issue, and this hard-to-use
      semantics, by removing the ability of Lua, after the script execution,
      to force the caller to switch to the DB selected by the Lua script.
      
      The new behavior of the previous sequence of commadns is to just set
      X=20 in DB 0. However Lua scripts are still capable of writing / reading
      from different DBs if needed.
      
      WARNING: This is a semantical change that will break programs that are
      conceived to select the client selected DB via Lua scripts.
      
      This fixes issue #1811.
      2b57d96e
    • antirez's avatar
      Cluser test: write multiple keys in unit 03. · 62bddfe3
      antirez authored
      The write-failover-read test is better if we write 100 keys so that we
      are sure all the nodes are affected by the write.
      62bddfe3
    • antirez's avatar
      1381a6bf