30 Commits

Author SHA1 Message Date
antirez
0332a321ba Typo in comment. 2012-07-09 12:02:01 +02:00
antirez
b998ebe904 REPLCONF internal command introduced.
The REPLCONF command is an internal command (not designed to be directly
used by normal clients) that allows a slave to set some replication
related state in the master before issuing SYNC to start the
replication.

The initial motivation for this command, and the only reason currently
it is used by the implementation, is to let the slave instance
communicate its listening port to the slave, so that the master can
show all the slaves with their listening ports in the "replication"
section of the INFO output.

This allows clients to auto discover and query all the slaves attached
into a master.

Currently only a single option of the REPLCONF command is supported, and
it is called "listening-port", so the slave now starts the replication
process with something like the following chat:

    REPLCONF listening-prot 6380
    SYNC

Note that this works even if the master is an older version of Redis and
does not understand REPLCONF, because the slave ignores the REPLCONF
error.

In the future REPLCONF can be used for partial replication and other
replication related features where there is the need to exchange
information between master and slave.

NOTE: This commit also fixes a bug: the INFO outout already carried
information about slaves, but the port was broken, and was obtained
with getpeername(2), so it was actually just the ephemeral port used
by the slave to connect to the master as a client.
2012-07-09 11:59:42 +02:00
Salvatore Sanfilippo
3c38b0876e Merge pull request #417 from josephjang/e95ca1db21b2dbe82f39a3f7f6390cb5f58dafae
a memory leak with replication on two or more dbs including >= db10
2012-03-30 01:28:58 -07:00
Joseph Jang
e95ca1db21 Fixed a memory leak with replication
occurs when two or more dbs are replicated and at least one of them is >db10
2012-03-30 02:17:21 +09:00
antirez
6938960b66 Fix for slaves chains. Force resync of slaves (simply disconnecting them) when SLAVEOF turns a master into a slave. 2012-03-29 09:31:39 +02:00
antirez
a5045d552c Fixed replication when multiple slaves are attaching at the same time. The output buffer was not copied correctly between slaves. This fixes issue #141. 2012-01-07 12:48:10 +01:00
antirez
67d6b29404 Replication bug fixed: now non blocking connect is also forced to follow the configured replication timeout. 2011-11-30 17:13:15 +01:00
Herbert G. Fischer
7c6da7327f Added repl_ping_slave_period and repl_timeout options support 2011-10-18 18:56:10 -02:00
antirez
b6fe152b83 Fix to the previous fix for issue #145, make sure to return only after the event was unregistered. 2011-10-18 17:12:16 +02:00
antirez
98f5abb6e3 Return from syncWithMaster() ASAP if the event fired but the instance is no longer a slave. This should fix Issue #145. 2011-10-18 11:09:32 +02:00
antirez
7638130d6e Two fixes for replication: Slave performs the AOF rewrite at the right point. Non blocking connect also uses readable handler as with old Linux kernels like 2.6.18 on connection refused the writable even is not fired (kernel bug). 2011-06-09 15:35:18 +02:00
Pieter Noordhuis
afc151d3ba Make replication faster (biggest gain for small number of slaves) 2011-05-29 17:55:13 -07:00
Pieter Noordhuis
ecfc0583da Configurable synchronous I/O timeout 2011-05-22 12:57:56 +02:00
Pieter Noordhuis
ff8d85885e Minor changes in non-blocking repl. connect 2011-05-22 12:48:10 +02:00
Pieter Noordhuis
78c05caf5e Non-blocking connect with master 2011-05-19 18:53:31 +02:00
antirez
eece2d528c suppress a Linux warning, for 2.2 sake 2011-02-21 17:50:54 +01:00
antirez
db0e263b42 Fixed issue #435 and at the same time introduced explicit ping in the master-slave channel that will detect a blocked master or a broken even if apparently connected TCP link. 2011-01-20 18:02:51 +01:00
Pieter Noordhuis
2b2eca1f56 Zero-pad timestamps in MONITOR output
Original report and fix:
http://code.google.com/p/redis/issues/detail?id=404
2010-12-14 17:39:34 +01:00
antirez
9fd01051bf Fix for bug 374, thanks to Jeremy Zawodny for reporting and tracing why it was crashing. 2010-11-12 20:02:20 +01:00
antirez
f6433915fe more replication info in logs 2010-11-04 18:14:20 +01:00
antirez
26b3366993 non blocking slave replication is now more non blocking than the first implementation... 2010-11-04 18:09:35 +01:00
antirez
62ec599c36 typos and minor stuff fixed in the new non blocking replication code 2010-11-04 17:35:03 +01:00
antirez
f4aa600b99 first attempt to non blocking implementation of slave replication and SYNC bulk data download. Never compiled so far... 2010-11-04 17:29:53 +01:00
antirez
19e61097c5 synchronous I/O networking functions originally used just for replication refactored in a file as generally useful, they are used in the cluster branch for MIGRATE. 2010-10-24 16:22:52 +02:00
Pieter Noordhuis
3ab203762f Use specialized function to add status and error replies 2010-09-02 23:33:06 +02:00
antirez
09252fc4f3 Fixed another instace of the Issue 173 2010-08-27 12:46:10 +02:00
antirez
b91d605a35 slave now detect lost connection during SYNC, fixing Issue 173 2010-08-24 16:25:00 +02:00
antirez
778b2210a9 slave with attached slaves now close the conection to all the slaves when the connection to the master is lost. Now a slave without a connected link to the master will refuse SYNC from other slaves. Enhanced the replication error reporting. All this will fix Issue 156 2010-08-24 16:04:13 +02:00
antirez
d3b958c3fc Fixed MONITOR output for consistency: now integer encoded values are also formatted like this: "3932" 2010-07-01 20:22:46 +02:00
antirez
e2641e09cc redis.c split into many different C files.
networking related stuff moved into networking.c

moved more code

more work on layout of source code

SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;)

cleanly compiling again after the first split, now splitting it in more C files

moving more things around... work in progress

split replication code

splitting more

Sets split

Hash split

replication split

even more splitting

more splitting

minor change
2010-07-01 14:38:51 +02:00