1. 07 Oct, 2019 1 commit
  2. 27 Sep, 2019 1 commit
  3. 05 Aug, 2019 1 commit
  4. 30 Jul, 2019 2 commits
  5. 17 Jul, 2019 1 commit
    • Oran Agra's avatar
      Module API for Forking · 56258c6b
      Oran Agra authored
      * create module API for forking child processes.
      * refactor duplicate code around creating and tracking forks by AOF and RDB.
      * child processes listen to SIGUSR1 and dies exitFromChild in order to
        eliminate a valgrind warning of unhandled signal.
      * note that BGSAVE error reply has changed.
      
      valgrind error is:
        Process terminating with default action of signal 10 (SIGUSR1)
      56258c6b
  6. 10 Jul, 2019 2 commits
  7. 08 Jul, 2019 2 commits
    • antirez's avatar
      81b18fa3
    • Oran Agra's avatar
      diskless replication on slave side (don't store rdb to file), plus some other related fixes · 2de544cf
      Oran Agra authored
      The implementation of the diskless replication was currently diskless only on the master side.
      The slave side was still storing the received rdb file to the disk before loading it back in and parsing it.
      
      This commit adds two modes to load rdb directly from socket:
      1) when-empty
      2) using "swapdb"
      the third mode of using diskless slave by flushdb is risky and currently not included.
      
      other changes:
      --------------
      distinguish between aof configuration and state so that we can re-enable aof only when sync eventually
      succeeds (and not when exiting from readSyncBulkPayload after a failed attempt)
      also a CONFIG GET and INFO during rdb loading would have lied
      
      When loading rdb from the network, don't kill the server on short read (that can be a network error)
      
      Fix rdb check when performed on preamble AOF
      
      tests:
      run replication tests for diskless slave too
      make replication test a bit more aggressive
      Add test for diskless load swapdb
      2de544cf
  8. 15 May, 2019 1 commit
    • antirez's avatar
      Narrow the effects of PR #6029 to the exact state. · 074d24df
      antirez authored
      CLIENT PAUSE may be used, in other contexts, for a long time making all
      the slaves time out. Better for now to be more specific about what
      should disable senidng PINGs.
      
      An alternative to that would be to virtually refresh the slave
      interactions when clients are paused, however for now I went for this
      more conservative solution.
      074d24df
  9. 17 Apr, 2019 1 commit
  10. 21 Mar, 2019 2 commits
  11. 20 Mar, 2019 2 commits
  12. 18 Mar, 2019 1 commit
  13. 10 Mar, 2019 1 commit
  14. 09 Mar, 2019 1 commit
  15. 12 Feb, 2019 1 commit
    • zhaozhao.zz's avatar
      ACL: add masteruser configuration for replication · ea9d3aef
      zhaozhao.zz authored
      In mostly production environment, normal user's behavior should be
      limited.
      
      Now in redis ACL mechanism we can do it like that:
      
          user default on +@all ~* -@dangerous nopass
          user admin on +@all ~* >someSeriousPassword
      
      Then the default normal user can not execute dangerous commands like
      FLUSHALL/KEYS.
      
      But some admin commands are in dangerous category too like PSYNC,
      and the configurations above will forbid replica from sync with master.
      
      Finally I think we could add a new configuration for replication,
      it is masteruser option, like this:
      
          masteruser admin
          masterauth someSeriousPassword
      
      Then replica will try AUTH admin someSeriousPassword and get privilege
      to execute PSYNC. If masteruser is NULL, replica would AUTH with only
      masterauth like before.
      ea9d3aef
  16. 25 Jan, 2019 1 commit
  17. 21 Jan, 2019 3 commits
  18. 17 Jan, 2019 1 commit
  19. 09 Jan, 2019 2 commits
  20. 31 Oct, 2018 1 commit
  21. 05 Oct, 2018 1 commit
  22. 27 Sep, 2018 1 commit
  23. 19 Sep, 2018 1 commit
  24. 11 Sep, 2018 2 commits
  25. 17 Jul, 2018 1 commit
    • Oran Agra's avatar
      fix rare replication stream corruption with disk-based replication · d5559898
      Oran Agra authored
      The slave sends \n keepalive messages to the master while parsing the rdb,
      and later sends REPLCONF ACK once a second. rarely, the master recives both
      a linefeed char and a REPLCONF in the same read, \n*3\r\n$8\r\nREPLCONF\r\n...
      and it tries to trim two chars (\r\n) from the query buffer,
      trimming the '*' from *3\r\n$8\r\nREPLCONF\r\n...
      
      then the master tries to process a command starting with '3' and replies to
      the slave a bunch of -ERR and one +OK.
      although the slave silently ignores these (prints a log message), this corrupts
      the replication offset at the slave since the slave increases the replication
      offset, and the master did not.
      
      other than the fix in processInlineBuffer, i did several other improvments
      while hunting this very rare bug.
      
      - when redis replies with "unknown command" it includes a portion of the
        arguments, not just the command name. so it would be easier to understand
        what was recived, in my case, on the slave side,  it was -ERR, but
        the "arguments" were the interesting part (containing info on the error).
      - about a year ago i added code in addReplyErrorLength to print the error to
        the log in case of a reply to master (since this string isn't actually
        trasmitted to the master), now changed that block to print a similar log
        message to indicate an error being sent from the master to the slave.
        note that the slave is marked as CLIENT_SLAVE only after PSYNC was received,
        so this will not cause any harm for REPLCONF, and will only indicate problems
        that are gonna corrupt the replication stream anyway.
      - two places were c->reply was emptied, and i wanted to reset sentlen
        this is a precaution (i did not actually see such a problem), since a
        non-zero sentlen will cause corruption to be transmitted on the socket.
      d5559898
  26. 16 Jul, 2018 1 commit
    • Oran Agra's avatar
      slave buffers were wasteful and incorrectly counted causing eviction · bf680b6f
      Oran Agra authored
      A) slave buffers didn't count internal fragmentation and sds unused space,
         this caused them to induce eviction although we didn't mean for it.
      
      B) slave buffers were consuming about twice the memory of what they actually needed.
      - this was mainly due to sdsMakeRoomFor growing to twice as much as needed each time
        but networking.c not storing more than 16k (partially fixed recently in 237a38737).
      - besides it wasn't able to store half of the new string into one buffer and the
        other half into the next (so the above mentioned fix helped mainly for small items).
      - lastly, the sds buffers had up to 30% internal fragmentation that was wasted,
        consumed but not used.
      
      C) inefficient performance due to starting from a small string and reallocing many times.
      
      what i changed:
      - creating dedicated buffers for reply list, counting their size with zmalloc_size
      - when creating a new reply node from, preallocate it to at least 16k.
      - when appending a new reply to the buffer, first fill all the unused space of the
        previous node before starting a new one.
      
      other changes:
      - expose mem_not_counted_for_evict info field for the benefit of the test suite
      - add a test to make sure slave buffers are counted correctly and that they don't cause eviction
      bf680b6f
  27. 03 Jul, 2018 2 commits
    • Jack Drogon's avatar
      Fix typo · 93238575
      Jack Drogon authored
      93238575
    • antirez's avatar
      Set repl_down_since to zero on state change. · 677d10b2
      antirez authored
      PR #5081 fixes an "interesting" bug about Redis Cluster failover but in
      general about the updating of repl_down_since, that is used in order to
      count the time a slave was left disconnected from its master.
      
      While the fix provided resolves the specific issue, in general the
      validity of repl_down_since is limited to states that are different
      than the state CONNECTED, and the disconnected time is set when the
      state is DISCONNECTED. However from CONNECTED to other states, the state
      machine must always go to DISCONNECTED first. So it makes sense to set
      the field to zero (since it is meaningless in that context) when the
      state is set to CONNECTED.
      677d10b2
  28. 30 Jun, 2018 1 commit
  29. 26 Jun, 2018 2 commits