1. 29 Apr, 2020 2 commits
    • antirez's avatar
      Comment clearly why we moved some code in #6623. · d2a6c5ff
      antirez authored
      d2a6c5ff
    • srzhao's avatar
      fix pipelined WAIT performance issue. · 4024bc7e
      srzhao authored
      If client gets blocked again in `processUnblockedClients`, redis will not send
      `REPLCONF GETACK *` to slaves untill next eventloop, so the client will be
      blocked for 100ms by default(10hz) if no other file event fired.
      
      move server.get_ack_from_slaves sinppet after `processUnblockedClients`, so
      that both the first WAIT command that puts client in blocked context and the
      following WAIT command processed in processUnblockedClients would trigger
      redis-sever to send `REPLCONF GETACK *`, so that the eventloop would get
      `REPLCONG ACK <reploffset>` from slaves and unblocked ASAP.
      4024bc7e
  2. 28 Apr, 2020 1 commit
    • Oran Agra's avatar
      hickup, re-fix dictEncObjKeyCompare · 9a3dab0a
      Oran Agra authored
      come to think of it, in theory (not in practice), getDecodedObject can
      return the same original object with refcount incremented, so the
      pointer comparision in the previous commit was invalid.
      so now instead of checking the encoding, we explicitly check the
      refcount.
      9a3dab0a
  3. 27 Apr, 2020 3 commits
  4. 25 Apr, 2020 1 commit
  5. 24 Apr, 2020 1 commit
    • antirez's avatar
      LCS -> STRALGO LCS. · 8a7f255c
      antirez authored
      STRALGO should be a container for mostly read-only string
      algorithms in Redis. The algorithms should have two main
      characteristics:
      
      1. They should be non trivial to compute, and often not part of
      programming language standard libraries.
      2. They should be fast enough that it is a good idea to have optimized C
      implementations.
      
      Next thing I would love to see? A small strings compression algorithm.
      8a7f255c
  6. 20 Apr, 2020 1 commit
  7. 17 Apr, 2020 1 commit
  8. 08 Apr, 2020 1 commit
  9. 07 Apr, 2020 1 commit
    • antirez's avatar
      Speedup INFO by counting client memory incrementally. · f6987628
      antirez authored
      Related to #5145.
      
      Design note: clients may change type when they turn into replicas or are
      moved into the Pub/Sub category and so forth. Moreover the recomputation
      of the bytes used is problematic for obvious reasons: it changes
      continuously, so as a conservative way to avoid accumulating errors,
      each client remembers the contribution it gave to the sum, and removes
      it when it is freed or before updating it with the new memory usage.
      f6987628
  10. 02 Apr, 2020 1 commit
    • Guy Benoish's avatar
      Stale replica should allow MULTI/EXEC · 85a0d29d
      Guy Benoish authored
      Example: Client uses a pipe to send the following to a
      stale replica:
      
      MULTI
      .. do something ...
      DISCARD
      
      The replica will reply the MUTLI with -MASTERDOWN and
      execute the rest of the commands... A client using a
      pipe might not be aware that MULTI failed until it's
      too late.
      
      I can't think of a reason why MULTI/EXEC/DISCARD should
      not be executed on stale replicas...
      
      Also, enable MULTI/EXEC/DISCARD during loading
      85a0d29d
  11. 01 Apr, 2020 2 commits
    • antirez's avatar
      LCS: initial functionality implemented. · 1010c1b4
      antirez authored
      1010c1b4
    • Guy Benoish's avatar
      Fix memory corruption in moduleHandleBlockedClients · c4dc5b80
      Guy Benoish authored
      By using a "circular BRPOPLPUSH"-like scenario it was
      possible the get the same client on db->blocking_keys
      twice (See comment in moduleTryServeClientBlockedOnKey)
      
      The fix was actually already implememnted in
      moduleTryServeClientBlockedOnKey but it had a bug:
      the funxction should return 0 or 1 (not OK or ERR)
      
      Other changes:
      1. Added two commands to blockonkeys.c test module (To
         reproduce the case described above)
      2. Simplify blockonkeys.c in order to make testing easier
      3. cast raxSize() to avoid warning with format spec
      c4dc5b80
  12. 31 Mar, 2020 4 commits
  13. 27 Mar, 2020 8 commits
  14. 26 Mar, 2020 1 commit
  15. 25 Mar, 2020 2 commits
    • antirez's avatar
      PSYNC2: meaningful offset implemented. · 57fa355e
      antirez authored
      A very commonly signaled operational problem with Redis master-replicas
      sets is that, once the master becomes unavailable for some reason,
      especially because of network problems, many times it wont be able to
      perform a partial resynchronization with the new master, once it rejoins
      the partition, for the following reason:
      
      1. The master becomes isolated, however it keeps sending PINGs to the
      replicas. Such PINGs will never be received since the link connection is
      actually already severed.
      2. On the other side, one of the replicas will turn into the new master,
      setting its secondary replication ID offset to the one of the last
      command received from the old master: this offset will not include the
      PINGs sent by the master once the link was already disconnected.
      3. When the master rejoins the partion and is turned into a replica, its
      offset will be too advanced because of the PINGs, so a PSYNC will fail,
      and a full synchronization will be required.
      
      Related to issue #7002 and other discussion we had in the past around
      this problem.
      57fa355e
    • antirez's avatar
      Explain why we allow transactions in -BUSY state. · f15042db
      antirez authored
      Related to #7022.
      f15042db
  16. 23 Mar, 2020 2 commits
    • Oran Agra's avatar
      MULTI/EXEC during LUA script timeout are messed up · ec007559
      Oran Agra authored
      Redis refusing to run MULTI or EXEC during script timeout may cause partial
      transactions to run.
      
      1) if the client sends MULTI+commands+EXEC in pipeline without waiting for
      response, but these arrive to the shards partially while there's a busy script,
      and partially after it eventually finishes: we'll end up running only part of
      the transaction (since multi was ignored, and exec would fail).
      
      2) similar to the above if EXEC arrives during busy script, it'll be ignored and
      the client state remains in a transaction.
      
      the 3rd test which i added for a case where MULTI and EXEC are ok, and
      only the body arrives during busy script was already handled correctly
      since processCommand calls flagTransaction
      ec007559
    • antirez's avatar
      918086e2
  17. 20 Mar, 2020 1 commit
  18. 18 Mar, 2020 1 commit
    • WuYunlong's avatar
      Fix master replica inconsistency for upgrading scenario. · f6029fb9
      WuYunlong authored
      Before this commit, when upgrading a replica, expired keys will not
      be loaded, thus causing replica having less keys in db. To this point,
      master and replica's keys is logically consistent. However, before
      the keys in master and replica are physically consistent, that is,
      they have the same dbsize, if master got a problem and the replica
      got promoted and becomes new master of that partition, and master
      updates a key which does not exist on master, but physically exists
      on the old master(new replica), the old master would refuse to update
      the key, thus causing master and replica data inconsistent.
      
      How could this happen?
      That's all because of the wrong judgement of roles while starting up
      the server. We can not use server.masterhost to judge if the server
      is master or replica, since it fails in cluster mode.
      
      When we start the server, we load rdb and do want to load expired keys,
      and do not want to have the ability to active expire keys, if it is
      a replica.
      f6029fb9
  19. 16 Mar, 2020 1 commit
  20. 04 Mar, 2020 1 commit
  21. 03 Mar, 2020 1 commit
  22. 12 Feb, 2020 1 commit
  23. 10 Feb, 2020 1 commit
  24. 07 Feb, 2020 1 commit