summaryrefslogtreecommitdiff
path: root/src/syncio.c
Commit message (Collapse)AuthorAgeFilesLines
* syncWithMaster(): non blocking state machine.statemachineantirez2015-08-061-12/+4
|
* Fix synchronous readline "\n" handling.antirez2015-08-051-0/+3
| | | | | | | Our function to read a line with a timeout handles newlines as requests to refresh the timeout, however the code kept subtracting the buffer size left every time a newline was received, for a bug in the loop logic. Fixed by this commit.
* PSYNC initial offset fix.antirez2015-08-041-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | This commit attempts to fix a bug involving PSYNC and diskless replication (currently experimental) found by Yuval Inbar from Redis Labs and that was later found to have even more far reaching effects (the bug also exists when diskstore is off). The gist of the bug is that, a Redis master replies with +FULLRESYNC to a PSYNC attempt that fails and requires a full resynchronization. However, the baseline offset sent along with FULLRESYNC was always the current master replication offset. This is not ok, because there are many reasosn that may delay the RDB file creation. And... guess what, the master offset we communicate must be the one of the time the RDB was created. So for example: 1) When the BGSAVE for replication is delayed since there is one already but is not good for replication. 2) When the BGSAVE is not needed as we attach one currently ongoing. 3) When because of diskless replication the BGSAVE is delayed. In all the above cases the PSYNC reply is wrong and the slave may reconnect later claiming to need a wrong offset: this may cause data curruption later.
* RDMF: more names updated.antirez2015-07-271-5/+5
|
* RDMF (Redis/Disque merge friendlyness) refactoring WIP 1.antirez2015-07-261-1/+1
|
* syncReadLine(): actually enforce buffer size limits.antirez2014-10-161-0/+1
|
* No more trailing spaces in Redis source code.antirez2014-06-261-1/+1
|
* syncio.c read / write functions reworked for correctness and performance.antirez2012-05-021-14/+28
| | | | | | | | | | | | | | The new implementation start reading / writing before blocking with aeWait(), likely the descriptor can accept writes or has buffered data inside and we can go faster, otherwise we get an error and wait. This change has effects on speed but also on correctness: on socket errors when we perform non blocking connect(2) write is performed ASAP and the error is returned ASAP before waiting. So the practical effect is that now a Redis slave is more available if it can not connect to the master, previously the slave continued to block on syncWrite() trying to send SYNC, and serving commands very slowly.
* Better syncio.c with millisecond resolution.antirez2012-03-311-16/+45
|
* Use rio.h functions in aof.cPieter Noordhuis2011-05-141-67/+0
|
* Cluster branch merged to unstable.antirez2011-03-291-0/+14
|
* more generally usable i/o functions moved to syncio.cantirez2010-10-251-6/+62
|
* synchronous I/O networking functions originally used just for replication ↵antirez2010-10-241-0/+98
refactored in a file as generally useful, they are used in the cluster branch for MIGRATE.