1. 05 Sep, 2018 5 commits
    • antirez's avatar
      6bd0d342
    • antirez's avatar
      Use commands (effects) replication by default in scripts. · 7895835d
      antirez authored
      See issue #5250 and issue #5292 for more info.
      7895835d
    • antirez's avatar
      Safer script stop condition on OOM. · 7e11825e
      antirez authored
      Here the idea is that we do not want freeMemoryIfNeeded() to propagate a
      DEL command before the script and change what happens in the script
      execution once it reaches the slave. For example see this potential
      issue (in the words of @soloestoy):
      
      On master, we run the following script:
      
          if redis.call('get','key')
          then
              redis.call('set','xxx','yyy')
          end
          redis.call('set','c','d')
      
      Then when redis attempts to execute redis.call('set','xxx','yyy'), we call freeMemoryIfNeeded(), and the key may get deleted, and because redis.call('set','xxx','yyy') has already been executed on master, this script will be replicated to slave.
      
      But the slave received "DEL key" before the script, and will ignore maxmemory, so after that master has xxx and c, slave has only one key c.
      
      Note that this patch (and other related work) was authored collaboratively in
      issue #5250 with the help of @soloestoy and @oranagra.
      
      Related to issue #5250.
      7e11825e
    • antirez's avatar
      Propagate read-only scripts as SCRIPT LOAD. · 092e4de6
      antirez authored
      See issue #5250 and the new comments added to the code in this commit
      for details.
      092e4de6
    • antirez's avatar
      Don't perform eviction when re-entering the event loop. · 51b627d9
      antirez authored
      Related to #5250.
      51b627d9
  2. 04 Sep, 2018 7 commits
  3. 03 Sep, 2018 6 commits
  4. 31 Aug, 2018 6 commits
    • antirez's avatar
      Test: processing of master stream in slave -BUSY state. · febe102b
      antirez authored
      See #5297.
      febe102b
    • antirez's avatar
      After slave Lua script leaves busy state, re-process the master buffer. · 7fa49391
      antirez authored
      Technically speaking we don't really need to put the master client in
      the clients that need to be processed, since in practice the PING
      commands from the master will take care, however it is conceptually more
      sane to do so.
      7fa49391
    • antirez's avatar
      While the slave is busy, just accumulate master input. · 9ab91b8c
      antirez authored
      Processing command from the master while the slave is in busy state is
      not correct, however we cannot, also, just reply -BUSY to the
      replication stream commands from the master. The correct solution is to
      stop processing data from the master, but just accumulate the stream
      into the buffers and resume the processing later.
      
      Related to #5297.
      9ab91b8c
    • antirez's avatar
      Allow scripts to timeout even if from the master instance. · 83af8ef1
      antirez authored
      However the master scripts will be impossible to kill.
      
      Related to #5297.
      83af8ef1
    • antirez's avatar
      Allow scripts to timeout on slaves as well. · f5b29c64
      antirez authored
      See reasoning in #5297.
      f5b29c64
    • zhaozhao.zz's avatar
      networking: fix unexpected negative or zero readlen · dce7cefb
      zhaozhao.zz authored
      To avoid copying buffers to create a large Redis Object which
      exceeding PROTO_IOBUF_LEN 32KB, we just read the remaining data
      we need, which may less than PROTO_IOBUF_LEN. But the remaining
      len may be zero, if the bulklen+2 equals sdslen(c->querybuf),
      in client pause context.
      
      For example:
      
      Time1:
      
      python
      >>> import os, socket
      >>> server="127.0.0.1"
      >>> port=6379
      >>> data1="*3\r\n$3\r\nset\r\n$1\r\na\r\n$33000\r\n"
      >>> data2="".join("x" for _ in range(33000)) + "\r\n"
      >>> data3="\n\n"
      >>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      >>> s.settimeout(10)
      >>> s.connect((server, port))
      >>> s.send(data1)
      28
      
      Time2:
      
      redis-cli client pause 10000
      
      Time3:
      
      >>> s.send(data2)
      33002
      >>> s.send(data3)
      2
      >>> s.send(data3)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      socket.error: [Errno 104] Connection reset by peer
      
      To fix that, we should check if remaining is greater than zero.
      dce7cefb
  5. 29 Aug, 2018 7 commits
  6. 27 Aug, 2018 8 commits
  7. 26 Aug, 2018 1 commit