1. 11 Jan, 2016 2 commits
  2. 08 Jan, 2016 2 commits
  3. 06 Jan, 2016 1 commit
    • antirez's avatar
      Cluster: don't send -ASK to MIGRATE. · 00d637f2
      antirez authored
      For non existing keys, we don't want to send -ASK redirections to
      MIGRATE, since when moving slots from the migrating node to the
      importing node, we want just to ignore keys that are no longer there.
      They may be expired or deleted between the GETKEYSINSLOT call and the
      MIGRATE call. Otherwise this causes an error during migrations with
      redis-trib (or equivalent cluster management tools).
      00d637f2
  4. 16 Dec, 2015 1 commit
  5. 11 Dec, 2015 4 commits
    • antirez's avatar
      ac0a7310
    • antirez's avatar
      MIGRATE: fix replies processing and argument rewriting. · d85fc1e9
      antirez authored
      We need to process replies after errors in order to delete keys
      successfully transferred. Also argument rewriting was fixed since
      it was broken in several ways. Now a fresh argument vector is created
      and set if we are acknowledged of at least one key.
      d85fc1e9
    • antirez's avatar
      Pipelined multiple keys MIGRATE. · 9ebf7a67
      antirez authored
      9ebf7a67
    • antirez's avatar
      Cluster: replica migration with delay. · adc2fe69
      antirez authored
      We wait a fixed amount of time (5 seconds currently) much greater than
      the usual Cluster node to node communication latency, before migrating.
      This way when a failover occurs, before detecting the new master as a
      target for migration, we give the time to its natural slaves (the slaves
      of the failed over master) to announce they switched to the new master,
      preventing an useless migration operation.
      adc2fe69
  6. 10 Dec, 2015 1 commit
  7. 09 Dec, 2015 1 commit
    • antirez's avatar
      Fix replicas migration by adding a new flag. · e0f22df9
      antirez authored
      Some time ago I broken replicas migration (reported in #2924).
      The idea was to prevent masters without replicas from getting replicas
      because of replica migration, I remember it to create issues with tests,
      but there is no clue in the commit message about why it was so
      undesirable.
      
      However my patch as a side effect totally ruined the concept of replicas
      migration since we want it to work also for instances that, technically,
      never had slaves in the past: promoted slaves.
      
      So now instead the ability to be targeted by replicas migration, is a
      new flag "migrate-to". It only applies to masters, and is set in the
      following two cases:
      
      1. When a master gets a slave, it is set.
      2. When a slave turns into a master because of fail over, it is set.
      
      This way replicas migration targets are only masters that used to have
      slaves, and slaves of masters (that used to have slaves... obviously)
      and are promoted.
      
      The new flag is only internal, and is never exposed in the output nor
      persisted in the nodes configuration, since all the information to
      handle it are implicit in the cluster configuration we already have.
      e0f22df9
  8. 27 Nov, 2015 1 commit
  9. 01 Oct, 2015 2 commits
  10. 27 Jul, 2015 3 commits
  11. 26 Jul, 2015 6 commits
  12. 24 Jun, 2015 1 commit
  13. 11 Jun, 2015 1 commit
  14. 24 Mar, 2015 1 commit
    • antirez's avatar
      Cluster: redirection refactoring + handling of blocked clients. · 9b7f8b1c
      antirez authored
      There was a bug in Redis Cluster caused by clients blocked in a blocking
      list pop operation, for keys no longer handled by the instance, or
      in a condition where the cluster became down after the client blocked.
      
      A typical situation is:
      
      1) BLPOP <somekey> 0
      2) <somekey> hash slot is resharded to another master.
      
      The client will block forever int this case.
      
      A symmentrical non-cluster-specific bug happens when an instance is
      turned from master to slave. In that case it is more serious since this
      will desynchronize data between slaves and masters. This other bug was
      discovered as a side effect of thinking about the bug explained and
      fixed in this commit, but will be fixed in a separated commit.
      9b7f8b1c
  15. 21 Mar, 2015 2 commits
  16. 20 Mar, 2015 4 commits
    • antirez's avatar
    • antirez's avatar
      Cluster: separate unknown master check from the rest. · 230d1414
      antirez authored
      In no case we should try to attempt to failover if myself->slaveof is
      NULL.
      230d1414
    • antirez's avatar
      Cluster: refactoring around configEpoch handling. · 4f2555aa
      antirez authored
      This commit moves the process of generating a new config epoch without
      consensus out of the clusterCommand() implementation, in order to make
      it reusable for other reasons (current target is to have a CLUSTER
      FAILOVER option forcing the failover when no master majority is
      reachable).
      
      Moreover the commit moves other functions which are similarly related to
      config epochs in a new logical section of the cluster.c file, just for
      clarity.
      4f2555aa
    • antirez's avatar
      Cluster: better cluster state transiction handling. · 25c0f5ac
      antirez authored
      Before we relied on the global cluster state to make sure all the hash
      slots are linked to some node, when getNodeByQuery() is called. So
      finding the hash slot unbound was checked with an assertion. However
      this is fragile. The cluster state is often updated in the
      clusterBeforeSleep() function, and not ASAP on state change, so it may
      happen to process clients with a cluster state that is 'ok' but yet
      certain hash slots set to NULL.
      
      With this commit the condition is also checked in getNodeByQuery() and
      reported with a identical error code of -CLUSTERDOWN but slightly
      different error message so that we have more debugging clue in the
      future.
      
      Root cause of issue #2288.
      25c0f5ac
  17. 18 Mar, 2015 1 commit
  18. 13 Mar, 2015 2 commits
  19. 10 Mar, 2015 1 commit
  20. 27 Feb, 2015 1 commit
  21. 26 Feb, 2015 2 commits
    • antirez's avatar
      Improvements to PR #2425 · 832b0c7c
      antirez authored
      1. Remove useless "cs" initialization.
      2. Add a "select" var to capture a condition checked multiple times.
      3. Avoid duplication of the same if (!copy) conditional.
      4. Don't increment dirty if copy is given (no deletion is performed),
         otherwise we propagate MIGRATE when not needed.
      832b0c7c
    • Tommy Wang's avatar
      Add last_dbid to migrateCachedSocket to avoid redundant SELECT · 7fda935a
      Tommy Wang authored
      Avoid redundant SELECT calls when continuously migrating keys to
      the same dbid within a target Redis instance.
      7fda935a