1. 16 Jul, 2015 2 commits
    • antirez's avatar
      Client timeout handling improved. · b029ff11
      antirez authored
      The previos attempt to process each client at least once every ten
      seconds was not a good idea, because:
      
      1. Usually because of the past min iterations set to 50, you get much
      better processing period most of the times.
      
      2. However when there are many clients and a normal setting for
      server.hz, the edge case is triggered, and waiting 10 seconds for a
      BLPOP that asked for 1 second is not ok.
      
      3. Moreover, because of the high min-itereations limit of 50, when HZ
      was set to an high value, the actual behavior was to process a lot of
      clients per second.
      
      Also the function checking for timeouts called gettimeofday() at each
      iteration which can be costly.
      
      The new implementation will try to process each client once per second,
      gets the current time as argument, and does not attempt to process more
      than 5 clients per iteration if not needed.
      
      So now:
      
      1. The CPU usage of an idle Redis process is the same or better.
      2. The CPU usage of a busy Redis process is the same or better.
      3. However a non trivial amount of work may be performed per iteration
      when there are many many clients. In this particular case the user may
      want to raise the "HZ" value if needed.
      
      Btw with 4000 clients it was still not possible to noticy any actual
      latency created by processing 400 clients per second, since the work
      performed for each client is pretty small.
      b029ff11
    • antirez's avatar
      Clarify a comment in clientsCron(). · 5dcba26b
      antirez authored
      5dcba26b
  2. 13 Jul, 2015 1 commit
    • antirez's avatar
      EXISTS is now variadic. · 7ae1d4d6
      antirez authored
      The new return value is the number of keys existing, among the ones
      specified in the command line, counting the same key multiple times if
      given multiple times (and if it exists).
      
      See PR #2667.
      7ae1d4d6
  3. 24 Mar, 2015 1 commit
    • antirez's avatar
      Cluster: redirection refactoring + handling of blocked clients. · 3468cd36
      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.
      3468cd36
  4. 22 Mar, 2015 1 commit
  5. 21 Mar, 2015 1 commit
  6. 20 Mar, 2015 2 commits
    • antirez's avatar
      Cluster: better cluster state transiction handling. · 62893f5b
      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.
      62893f5b
    • antirez's avatar
      Cluster: move clusterBeforeSleep() call before unblocked clients processing. · 585f68ac
      antirez authored
      Related to issue #2288.
      585f68ac
  7. 18 Mar, 2015 1 commit
  8. 11 Feb, 2015 3 commits
  9. 23 Dec, 2014 1 commit
    • antirez's avatar
      INFO loading stats: three fixes. · 1e8f1577
      antirez authored
      1. Server unxtime may remain not updated while loading AOF, so ETA is
      not updated correctly.
      
      2. Number of processed byte was not initialized.
      
      3. Possible division by zero condition (likely cause of issue #1932).
      1e8f1577
  10. 19 Dec, 2014 1 commit
  11. 13 Dec, 2014 2 commits
  12. 04 Dec, 2014 1 commit
  13. 03 Dec, 2014 2 commits
  14. 02 Dec, 2014 1 commit
    • antirez's avatar
      Mark PFCOUNT as read-only, even if not true. · 69efb59a
      antirez authored
      PFCOUNT is technically speaking a write command, since the cached value
      of the HLL is exposed in the data structure (design error, mea culpa), and
      can be modified by PFCOUNT.
      
      However if we flag PFCOUNT as "w", read only slaves can't execute the
      command, which is a problem since there are environments where slaves
      are used to scale PFCOUNT reads.
      
      Nor it is possible to just prevent PFCOUNT to modify the data structure
      in slaves, since without the cache we lose too much efficiency.
      
      So while this commit allows slaves to create a temporary inconsistency
      (the strings representing the HLLs in the master and slave can be
      different in certain moments) it is actually harmless.
      
      In the long run this should be probably fixed by turning the HLL into a
      more opaque representation, for example by storing the cached value in
      the part of the string which is not exposed (this should be possible
      with SDS strings).
      69efb59a
  15. 12 Nov, 2014 1 commit
  16. 29 Oct, 2014 5 commits
  17. 06 Oct, 2014 2 commits
  18. 19 Sep, 2014 1 commit
  19. 17 Sep, 2014 1 commit
    • antirez's avatar
      Don't propagate SAVE. · ef61ab63
      antirez authored
      This is a general fix (check that dirty delta is positive) but actually
      should have as the only effect fixing the SAVE propagation to
      AOF and slaves.
      ef61ab63
  20. 08 Sep, 2014 1 commit
  21. 26 Aug, 2014 9 commits