1. 26 7月, 2015 2 次提交
  2. 11 6月, 2015 1 次提交
    • A
      Use best effort address binding to connect to the master · 8366907b
      antirez 提交于
      We usually want to reach the master using the address of the interface
      Redis is bound to (via the "bind" config option). That's useful since
      the master will get (and publish) the slave address getting the peer
      name of the incoming socket connection from the slave.
      
      However, when this is not possible, for example because the slave is
      bound to the loopback interface but repliaces from a master accessed via
      an external interface, we want to still connect with the master even
      from a different interface: in this case it is not really important that
      the master will provide any other address, while it is vital to be able
      to replicate correctly.
      
      Related to issues #2609 and #2612.
      8366907b
  3. 01 4月, 2015 2 次提交
    • A
      Net: improve prepareClientToWrite() error handling and comments. · 6c60526d
      antirez 提交于
      When we fail to setup the write handler it does not make sense to take
      the client around, it is missing writes: whatever is a client or a slave
      anyway the connection should terminated ASAP.
      
      Moreover what the function does exactly with its return value, and in
      which case the write handler is installed on the socket, was not clear,
      so the functions comment are improved to make the goals of the function
      more obvious.
      
      Also related to #2485.
      6c60526d
    • O
      fixes to diskless replication. · 159875b5
      Oran Agra 提交于
      master was closing the connection if the RDB transfer took long time.
      and also sent PINGs to the slave before it got the initial ACK, in which case the slave wouldn't be able to find the EOF marker.
      159875b5
  4. 24 3月, 2015 1 次提交
    • A
      Replication: disconnect blocked clients when switching to slave role. · c3ad7090
      antirez 提交于
      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
  5. 04 2月, 2015 1 次提交
  6. 12 12月, 2014 1 次提交
  7. 11 12月, 2014 1 次提交
  8. 03 12月, 2014 1 次提交
    • A
      Network bandwidth tracking + refactoring. · 1b732c09
      antirez 提交于
      Track bandwidth used by clients and replication (but diskless
      replication is not tracked since the actual transfer happens in the
      child process).
      
      This includes a refactoring that makes tracking new instantaneous
      metrics simpler.
      1b732c09
  9. 12 11月, 2014 1 次提交
    • A
      Diskless SYNC: fix RDB EOF detection. · bb7fea0d
      antirez 提交于
      RDB EOF detection was relying on the final part of the RDB transfer to
      be a magic 40 bytes EOF marker. However as the slave is put online
      immediately, and because of sockets timeouts, the replication stream is
      actually contiguous with the RDB file.
      
      This means that to detect the EOF correctly we should either:
      
      1) Scan all the stream searching for the mark. Sucks CPU-wise.
      2) Start to send the replication stream only after an acknowledge.
      3) Implement a proper chunked encoding.
      
      For now solution "2" was picked, so the master does not start to send
      ASAP the stream of commands in the case of diskless replication. We wait
      for the first REPLCONF ACK command from the slave, that certifies us
      that the slave correctly loaded the RDB file and is ready to get more
      data.
      bb7fea0d
  10. 11 11月, 2014 1 次提交
  11. 30 10月, 2014 1 次提交
    • M
      Networking: add more outbound IP binding fixes · 0014966c
      Matt Stancliff 提交于
      Same as the original bind fixes (we just missed these the
      first time around).
      
      This helps Redis not automatically send
      connections from the first IP on an interface if we are bound
      to a specific IP address (e.g. with multiple IP aliases on one
      interface, you want to send from _your_ IP, not from the first IP
      on the interface).
      0014966c
  12. 29 10月, 2014 1 次提交
    • A
      Diskless replication: missing listRewind() added. · 9ec22d92
      antirez 提交于
      This caused BGSAVE to be triggered a second time without any need when
      we switch from socket to disk target via the command
      
          CONFIG SET repl-diskless-sync no
      
      and there is already a slave waiting for the BGSAVE to start.
      Also comments clarified about what is happening.
      9ec22d92
  13. 27 10月, 2014 4 次提交
  14. 24 10月, 2014 1 次提交
  15. 17 10月, 2014 6 次提交
  16. 16 10月, 2014 5 次提交
  17. 15 10月, 2014 1 次提交
  18. 14 10月, 2014 1 次提交
  19. 10 10月, 2014 1 次提交
  20. 29 9月, 2014 2 次提交
  21. 27 6月, 2014 1 次提交
  22. 21 6月, 2014 1 次提交
  23. 07 6月, 2014 2 次提交
    • A
      ROLE output improved for slaves. · 6a13193d
      antirez 提交于
      Info about the replication state with the master added.
      6a13193d
    • A
      ROLE command added. · d34c2fa3
      antirez 提交于
      The new ROLE command is designed in order to provide a client with
      informations about the replication in a fast and easy to use way
      compared to the INFO command where the same information is also
      available.
      d34c2fa3
  24. 28 4月, 2014 1 次提交
    • A
      CLIENT LIST speedup via peerid caching + smart allocation. · 0bcc7cb4
      antirez 提交于
      This commit adds peer ID caching in the client structure plus an API
      change and the use of sdsMakeRoomFor() in order to improve the
      reallocation pattern to generate the CLIENT LIST output.
      
      Both the changes account for a very significant speedup.
      0bcc7cb4