diff options
author | antirez <antirez@gmail.com> | 2014-10-17 11:36:12 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-10-17 11:36:12 +0200 |
commit | 10aafdad56fa79bd7f95d9b190054b2e56b6cddd (patch) | |
tree | f5ab58cd684cde63040f3bdeedf2eff29ac24ada /src/rdb.c | |
parent | b1337b15b6b090315d884d7372eea344926ae95b (diff) | |
download | redis-10aafdad56fa79bd7f95d9b190054b2e56b6cddd.tar.gz |
Diskless replication: rio fdset target new supports buffering.
To perform a socket write() for each RDB rio API write call was
extremely unefficient, so now rio has minimal buffering capabilities.
Writes are accumulated into a buffer and only when a given limit is
reacehd are actually wrote to the N slaves FDs.
Trivia: rio lacked support for buffering since our targets were:
1) Memory buffers.
2) C standard I/O.
Both were buffered already.
Diffstat (limited to 'src/rdb.c')
-rw-r--r-- | src/rdb.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1425,6 +1425,9 @@ int rdbSaveToSlavesSockets(void) { redisSetProcTitle("redis-rdb-to-slaves"); retval = rdbSaveRioWithEOFMark(&slave_sockets,NULL); + if (retval == REDIS_OK && rioFlush(&slave_sockets) == 0) + retval = REDIS_ERR; + if (retval == REDIS_OK) { size_t private_dirty = zmalloc_get_private_dirty(); |