redis/src
antirez 27db38d069 Slaves heartbeat while loading RDB files.
Starting with Redis 2.8 masters are able to detect timed out slaves,
while before 2.8 only slaves were able to detect a timed out master.

Now that timeout detection is bi-directional the following problem
happens as described "in the field" by issue #1449:

1) Master and slave setup with big dataset.
2) Slave performs the first synchronization, or a full sync
   after a failed partial resync.
3) Master sends the RDB payload to the slave.
4) Slave loads this payload.
5) Master detects the slave as timed out since does not receive back the
   REPLCONF ACK acknowledges.

Here the problem is that the master has no way to know how much the
slave will take to load the RDB file in memory. The obvious solution is
to use a greater replication timeout setting, but this is a shame since
for the 0.1% of operation time we are forced to use a timeout that is
not what is suited for 99.9% of operation time.

This commit tries to fix this problem with a solution that is a bit of
an hack, but that modifies little of the replication internals, in order
to be back ported to 2.8 safely.

During the RDB loading time, we send the master newlines to avoid
being sensed as timed out. This is the same that the master already does
while saving the RDB file to still signal its presence to the slave.

The single newline is used because:

1) It can't desync the protocol, as it is only transmitted all or
nothing.
2) It can be safely sent while we don't have a client structure for the
master or in similar situations just with write(2).
2013-12-09 20:26:00 +01:00
..
.gitignore Ignore gcov/lcov artifacts 2012-04-13 17:52:33 -07:00
Makefile BLPOP blocking code refactored to be generic & reusable. 2013-12-03 17:43:53 +01:00
Makefile.dep Cluster: cluster stuff moved from redis.h to cluster.h. 2013-10-09 15:38:05 +02:00
adlist.c Fixed many typos. 2013-01-19 10:59:44 +01:00
adlist.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
ae.c ae.c event loop: API to resize the fd set size on the run. 2013-06-28 16:39:49 +02:00
ae.h ae.c event loop: API to resize the fd set size on the run. 2013-06-28 16:39:49 +02:00
ae_epoll.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
ae_evport.c ae.c event loop: API to resize the fd set size on the run. 2013-06-28 16:39:49 +02:00
ae_kqueue.c ae.c event loop: API to resize the fd set size on the run. 2013-06-28 16:39:49 +02:00
ae_select.c ae.c event loop: API to resize the fd set size on the run. 2013-06-28 16:39:49 +02:00
anet.c anet.c: save some vertical space. 2013-07-10 14:37:13 +02:00
anet.h Add IPv6 support to sentinel.c. 2013-07-08 16:08:36 +02:00
aof.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
asciilogo.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
bio.c Fixed many typos. 2013-01-19 10:59:44 +01:00
bio.h Make bio.c threads killable ASAP if needed. 2012-11-22 10:12:11 +01:00
bitops.c Introduction of a new string encoding: EMBSTR 2013-07-22 10:31:38 +02:00
blocked.c WAIT command: synchronous replication for Redis. 2013-12-04 16:20:03 +01:00
cluster.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
cluster.h Cluster: basic data structures for nodes black list. 2013-11-29 17:37:06 +01:00
config.c Merge branch 'newsentinel' into unstable 2013-11-21 15:01:25 +01:00
config.h Set proctitle: avoid the use of __attribute__((constructor)). 2013-02-27 11:50:35 +01:00
crc16.c Fixed many typos. 2013-01-19 10:59:44 +01:00
crc64.c crc64.c modified for incremental computation. 2012-04-09 12:20:47 +02:00
crc64.h Introduced the Build ID in INFO and --version output. 2012-11-29 14:20:08 +01:00
db.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
debug.c DEBUG SDSLEN added. 2013-08-27 11:53:49 +02:00
dict.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
dict.h Add SCAN command 2013-10-25 10:49:48 +02:00
endianconv.c endian.c/h -> endianconv.c/h to avoid issues with broken libraries search paths. 2012-02-14 16:11:46 +01:00
endianconv.h htonu64() and ntohu64 added to endianconv.h. 2013-09-25 09:26:36 +02:00
fmacros.h don't define _XOPEN_SOURCE for NetBSD 2013-05-17 17:19:02 +09:00
help.h redis-cli: help.h updated. 2013-05-14 11:23:16 +02:00
intset.c BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
intset.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
lzf.h redis.c split into many different C files. 2010-07-01 14:38:51 +02:00
lzfP.h Fixed many typos. 2013-01-19 10:59:44 +01:00
lzf_c.c redis.c split into many different C files. 2010-07-01 14:38:51 +02:00
lzf_d.c redis.c split into many different C files. 2010-07-01 14:38:51 +02:00
memtest.c Fixed a bug in memtest progress bar, that had no actual effects. 2013-01-21 12:34:22 +01:00
mkreleasehdr.sh suppress external diff program when using git diff. 2013-02-24 18:17:46 +01:00
multi.c Transactions: propagate MULTI/EXEC only when needed. 2013-03-26 10:58:10 +01:00
networking.c Slaves heartbeat while loading RDB files. 2013-12-09 20:26:00 +01:00
notify.c Keyspace notifications: fixed a leak and a bug introduced in the latest commit. 2013-01-28 13:15:16 +01:00
object.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
pqsort.c assert.h replaced with redisassert.h when appropriate. 2013-08-19 15:01:21 +02:00
pqsort.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
pubsub.c New API to force propagation. 2013-06-21 12:07:53 +02:00
rand.c BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
rand.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
rdb.c Slaves heartbeat while loading RDB files. 2013-12-09 20:26:00 +01:00
rdb.h Fixed many typos. 2013-01-19 10:59:44 +01:00
redis-benchmark.c redis-benchmark: update help for new __rand_int__ form. 2013-10-28 18:13:42 +01:00
redis-check-aof.c BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
redis-check-dump.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
redis-cli.c Document the redis-cli --csv option. 2013-09-26 10:12:46 +02:00
redis-trib.rb redis-trib: fixed slot allocation when --replicas is used. 2013-11-07 16:12:06 +01:00
redis.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
redis.h WAIT command: synchronous replication for Redis. 2013-12-04 16:20:03 +01:00
redisassert.h assert.h replaced with redisassert.h when appropriate. 2013-08-19 15:01:21 +02:00
release.c Fixed many typos. 2013-01-19 10:59:44 +01:00
replication.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
rio.c Chunked loading of RDB to prevent redis from stalling reading very large keys. 2013-07-16 15:41:24 +02:00
rio.h Fixed typo in rio.h, simgle -> single. 2013-07-16 15:43:36 +02:00
scripting.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
sds.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
sds.h Fix sdsempty() prototype in sds.h. 2013-08-12 11:38:21 +02:00
sentinel.c Sentinel: fix reported role info sampling. 2013-12-06 12:46:56 +01:00
setproctitle.c Set proctitle: avoid the use of __attribute__((constructor)). 2013-02-27 11:50:35 +01:00
sha1.c Fixed many typos. 2013-01-19 10:59:44 +01:00
sha1.h redis.c split into many different C files. 2010-07-01 14:38:51 +02:00
slowlog.c Introduction of a new string encoding: EMBSTR 2013-07-22 10:31:38 +02:00
slowlog.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
solarisfixes.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
sort.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
syncio.c syncio.c read / write functions reworked for correctness and performance. 2012-05-02 22:41:50 +02:00
t_hash.c SCAN code refactored to parse cursor first. 2013-11-05 15:47:50 +01:00
t_list.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
t_set.c SCAN code refactored to parse cursor first. 2013-11-05 15:47:50 +01:00
t_string.c Introduction of a new string encoding: EMBSTR 2013-07-22 10:31:38 +02:00
t_zset.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
testhelp.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
util.c Ignore sdsrange return value. 2013-07-24 18:59:54 +02:00
util.h pathIsBaseName() added to utils.c 2013-07-02 12:08:07 +02:00
valgrind.sup more valgrind friendly test 2011-07-06 15:22:00 +02:00
version.h Version bumped to 2.9.11 2013-05-27 11:44:04 +02:00
ziplist.c assert.h replaced with redisassert.h when appropriate. 2013-08-19 15:01:21 +02:00
ziplist.h BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
zipmap.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
zipmap.h mistype fixed 2013-09-03 15:15:51 +02:00
zmalloc.c Fixed grammar: before H the article is a, not an. 2013-12-05 16:35:32 +01:00
zmalloc.h zmalloc_get_private_dirty() function added (Linux only). 2012-11-19 11:47:35 +01:00