New issue 544 by dvir...@gmail.com: A server can be a slave of itself
http://code.google.com/p/redis/issues/detail?id=544
It is possible to make a server be its own slave. IMHO this should not be
allowed.
I'm seeing this with 2.2.5:
./redis-cli
redis> slaveof 127.0.0.1 6379
OK
redis> info
connected_clients:1
connected_slaves:0
....
role:slave
master_host:127.0.0.1
master_port:6379
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
and in the log, repeating infinitely:
[19171] 05 May 18:05:50 * SLAVE OF 127.0.0.1:6379 enabled (user request)
[19171] 05 May 18:05:51 * Connecting to MASTER...
[19171] 05 May 18:05:51 * MASTER <-> SLAVE sync started: SYNC sent
[19171] 05 May 18:05:51 - Accepted 127.0.0.1:45202
[19171] 05 May 18:05:51 # MASTER aborted replication with an error: ERR
Can't SYNC while not connected with my master
Comment #1 on issue 544 by anti...@gmail.com: A server can be a slave of
itself
http://code.google.com/p/redis/issues/detail?id=544
Hello, after all it is not a big problem as you can revert it with SLAVE OF
NOONE. Instead preventing this is a big problem, as you need to send
instance IDs or alike with the replication, as to try to understand this is
your own address is more complex or even impossible if routing
is "interesting" enough or you have TCP proxying.
So it is not perfect but neither a problem IMHO ;)
Thanks for reporting,
Salvatore
I suppose the client could run INFO and compare it to its own INFO, and
this can pretty much tell you it's the same instance. I agree it's not that
important, but it's something that actually happened to me (not using
localhost, of course) :)