- 12 Aug, 2013 4 commits
-
-
antirez authored
-
antirez authored
The previous code using a static buffer as an optimization was lame: 1) Premature optimization, actually it was *slower* than naive code because resulted into the creation / destruction of the object encapsulating the output buffer. 2) The code was very hard to test, since it was needed to have specific tests for command lines exceeding the size of the static buffer. 3) As a result of "2" the code was bugged as the current tests were not able to stress specific corner cases. It was replaced with easy to understand code that is safer and faster.
-
antirez authored
-
antirez authored
During the replication full resynchronization process, the RDB file is transfered from the master to the slave. However there is a short preamble to send, that is currently just the bulk payload length of the file in the usual Redis form $..length..<CR><LF>. This preamble used to be sent with a direct write call, assuming that there was alway room in the socket output buffer to hold the few bytes needed, however this does not scale in case we'll need to send more stuff, and is not very robust code in general. This commit introduces a more general mechanism to send a preamble up to 2GB in size (the max length of an sds string) in a non blocking way.
-
- 28 Jul, 2013 1 commit
-
-
antirez authored
This fixes issue #1221.
-
- 22 Jul, 2013 1 commit
-
-
antirez authored
-
- 12 Jul, 2013 1 commit
-
-
Ted Nyman authored
-
- 09 Jul, 2013 1 commit
-
-
antirez authored
-
- 08 Jul, 2013 2 commits
-
-
antirez authored
-
Geoff Garside authored
-
- 26 Jun, 2013 1 commit
-
-
antirez authored
Clients using SYNC to replicate are older implementations, such as redis-cli --slave, and are not designed to acknowledge the master with REPLCONF ACK commands, so we don't have any feedback and should not disconnect them on timeout.
-
- 24 Jun, 2013 2 commits
-
-
antirez authored
This commit uses the Replication Script Cache in order to avoid translating EVALSHA into EVAL whenever possible for both the AOF and slaves.
-
antirez authored
This code is only responsible to take an LRU-evicted fixed length cache of SHA1 that we are sure all the slaves received. In this commit only the implementation is provided, but the Redis core does not use it to actually send EVALSHA to slaves when possible.
-
- 30 May, 2013 2 commits
- 27 May, 2013 5 commits
-
-
antirez authored
Now masters, using the time at which the last REPLCONF ACK was received, are able to explicitly disconnect slaves that are no longer responding. Previously the only chance was to see a very long output buffer, that was highly suboptimal.
-
antirez authored
ACKs can be also used as a base for synchronous replication. However in that case they'll be explicitly requested by the master when the client sends a request that needs to be replicated synchronously.
-
antirez authored
Sending an ACK is now moved into the replicationSendAck() function.
-
antirez authored
-
antirez authored
This special command is used by the slave to inform the master the amount of replication stream it currently consumed. it does not return anything so that we not need to consume additional bandwidth needed by the master to reply something. The master can do a number of things knowing the amount of stream processed, such as understanding the "lag" in bytes of the slave, verify if a given command was already processed by the slave, and so forth.
-
- 05 Mar, 2013 1 commit
-
-
antirez authored
-
- 04 Mar, 2013 2 commits
- 27 Feb, 2013 1 commit
-
-
antirez authored
This commit also fixes redisLog() statements producing warnings.
-
- 13 Feb, 2013 2 commits
- 12 Feb, 2013 12 commits
-
-
antirez authored
-
antirez authored
-
antirez authored
-
antirez authored
-
antirez authored
When we are preparing an handshake with the slave we can't touch the connection buffer as it'll be used to accumulate differences between the sent RDB file and what arrives next from clients. So in short we can't use addReply() family functions. However we just use write(2) because we know that the socket buffer is empty, since a prerequisite for SYNC to work is that the static buffer and the output list are empty, and in general it is not expected that a client SYNCs after doing some heavy I/O with the master. However a short write connection is explicitly handled to avoid fragility (we simply close the connection and the slave will retry).
-
antirez authored
-
antirez authored
-
antirez authored
-
antirez authored
-
antirez authored
SELECT was still transmitted to slaves using the inline protocol, that is conceived mostly for humans to type into telnet sessions, and is notably not understood by redis-cli --slave. Now the new protocol is used instead.
-
antirez authored
A Redis master sends PING commands to slaves from time to time: doing this ensures that even if absence of writes, the master->slave channel remains active and the slave can feel the master presence, instead of closing the connection for timeout. This commit changes the way PINGs are sent to slaves in order to use the standard interface used to replicate all the other commands, that is, the function replicationFeedSlaves(). With this change the stream of commands sent to every slave is exactly the same regardless of their exact state (Transferring RDB for first synchronization or slave already online). With the previous implementation the PING was only sent to online slaves, with the result that the output stream from master to slaves was not identical for all the slaves: this is a problem if we want to implement partial resyncs in the future using a global replication stream offset. TL;DR: this commit should not change the behaviour in practical terms, but is just something in preparation for partial resynchronization support.
-
antirez authored
Before this commit every Redis slave had its own selected database ID state. This was not actually useful as the emitted stream of commands is identical for all the slaves. Now the the currently selected database is a global state that is set to -1 when a new slave is attached, in order to force the SELECT command to be re-emitted for all the slaves. This change is useful in order to implement replication partial resynchronization in the future, as makes sure that the stream of commands received by slaves, including SELECT commands, are exactly the same for every slave connected, at any time. In this way we could have a global offset that can identify a specific piece of the master -> slaves stream of commands.
-
- 08 Feb, 2013 1 commit
-
-
antirez authored
-
- 05 Feb, 2013 1 commit
-
-
antirez authored
-