1. 03 Sep, 2018 1 commit
  2. 14 Aug, 2018 1 commit
  3. 14 Jul, 2018 1 commit
  4. 10 Jul, 2018 3 commits
    • antirez's avatar
      Streams: fix typo "consumer". · 28e95c7c
      antirez authored
      28e95c7c
    • antirez's avatar
      Streams: send an error to consumers blocked on non-existing group. · a71e8148
      antirez authored
      To detect when the group (or the whole key) is destroyed to send an
      error to the consumers blocked in such group is a problem, so we leave
      the consumers listening, the sysadmin is free to create or destroy
      groups assuming she/he knows what to do. However a client may be blocked
      in a given consumer group, that is later destroyed. Then the stream
      receives new elements. In that case there is no sane behavior to serve
      the consumer... but to report an error about the group no longer
      existing.
      
      More about detecting this synchronously and why it is not done:
      
      1. Normally we don't do that, we leave clients blocked for other data
      types such as lists.
      
      2. When we free a stream object there is no longer information about
      what was the key it was associated with, so while destroying the
      consumer groups we miss the info to unblock the clients in that moment.
      
      3. Objects can be reclaimed in other threads where it is no longer safe
      to do client operations.
      a71e8148
    • antirez's avatar
      Streams: fix unblocking logic into a consumer group. · 09327f11
      antirez authored
      When a client blocks for a consumer group, we don't know the actual ID
      we want to be served: other clients blocked in the same consumer group
      may be served first, so the consumer group latest delivered ID changes.
      This was not handled correctly, all the clients in the consumer group
      were unblocked without data but the first.
      09327f11
  5. 09 Jul, 2018 1 commit
  6. 11 Jun, 2018 1 commit
    • antirez's avatar
      Fix client unblocking for XREADGROUP, issue #4978. · 34bd4418
      antirez authored
      We unblocked the client too early, when the group name object was no
      longer valid in client->bpop, so propagating XCLAIM later in
      streamPropagateXCLAIM() deferenced a field already set to NULL.
      34bd4418
  7. 31 May, 2018 1 commit
  8. 15 May, 2018 1 commit
  9. 11 May, 2018 2 commits
    • antirez's avatar
      ZPOP: change sync ZPOP to have a count argument instead of N keys. · 56bbab23
      antirez authored
      Usually blocking operations make a lot of sense with multiple keys so
      that we can listen to multiple queues (or whatever the app models) with
      a single connection. However in the synchronous case it is more useful
      to be able to ask for N elements. This is a change that I also wanted to
      perform soon or later in the blocking list variant, but here it is more
      natural since there is no reply type difference.
      56bbab23
    • antirez's avatar
      ZPOP: renaming to have explicit MIN/MAX score idea. · 6efb6c1e
      antirez authored
      This commit also adds a top comment about a subtle behavior of mixing
      blocking operations of different types in the same key.
      6efb6c1e
  10. 29 Apr, 2018 1 commit
  11. 22 Mar, 2018 1 commit
  12. 19 Mar, 2018 1 commit
  13. 15 Mar, 2018 5 commits
  14. 01 Dec, 2017 9 commits
  15. 07 Oct, 2016 1 commit
  16. 27 Jul, 2015 1 commit
  17. 26 Jul, 2015 4 commits
  18. 05 May, 2015 3 commits
  19. 24 Mar, 2015 2 commits
    • antirez's avatar
      Replication: disconnect blocked clients when switching to slave role. · c3ad7090
      antirez authored
      Bug as old as Redis and blocking operations. It's hard to trigger since
      only happens on instance role switch, but the results are quite bad
      since an inconsistency between master and slave is created.
      
      How to trigger the bug is a good description of the bug itself.
      
      1. Client does "BLPOP mylist 0" in master.
      2. Master is turned into slave, that replicates from New-Master.
      3. Client does "LPUSH mylist foo" in New-Master.
      4. New-Master propagates write to slave.
      5. Slave receives the LPUSH, the blocked client get served.
      
      Now Master "mylist" key has "foo", Slave "mylist" key is empty.
      
      Highlights:
      
      * At step "2" above, the client remains attached, basically escaping any
        check performed during command dispatch: read only slave, in that case.
      * At step "5" the slave (that was the master), serves the blocked client
        consuming a list element, which is not consumed on the master side.
      
      This scenario is technically likely to happen during failovers, however
      since Redis Sentinel already disconnects clients using the CLIENT
      command when changing the role of the instance, the bug is avoided in
      Sentinel deployments.
      
      Closes #2473.
      c3ad7090
    • 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