partial replication dosen't work

2,446 views
Skip to first unread message

wangjf

unread,
Apr 29, 2015, 12:23:05 AM4/29/15
to redi...@googlegroups.com
redis : 2.8.9


one  server ,one master,the master is always running. when i  reboot the slave server or shutdown slave process,  after the slave restart ,i always get this message :

[2410] 29 Apr 12:03:25.645 * MASTER <-> SLAVE sync started
[2410] 29 Apr 12:03:25.645 * Non blocking connect for SYNC fired the event.
[2410] 29 Apr 12:03:25.645 * Master replied to PING, replication can continue...
[2410] 29 Apr 12:03:25.646 * Partial resynchronization not possible (no cached master)
[2410] 29 Apr 12:03:25.646 * Full resync from master: 9de1915cf33dc9e9a393647dfe8234bae5dfac53:1

always with a full  resynchronization, why the partial replication dosen't work ?    what dose it means " no cached master "?  is it my configuration wrong ?


master configuration:
masterauth 1234567
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
repl-backlog-size 1000mb
repl-backlog-ttl 3600
slave-priority 100
requirepass 1234567




Jan-Erik Rediger

unread,
Apr 29, 2015, 1:46:20 AM4/29/15
to redi...@googlegroups.com
Nothing wrong with this.
Currently the state of the known server is not persisted to disk and
thus after a restart a full resynchronization is needed.

See also http://redis.io/topics/replication#partial-resynchronization:

> As the run id of the connected master is not persisted to disk, a full
> resynchronization is needed when the slave restarts.
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

王 军飞

unread,
Apr 29, 2015, 1:58:33 AM4/29/15
to redi...@googlegroups.com
Thanks for your help.

Sorry, why doesn¹t the slave save the run id of master to disk ? Is it
determined by a configuration parameter ?
I did config the ³save² parameter on both master and client side---- Save
³300 1"
I have read the documentation many times,and didn't find out the problems
.
>You received this message because you are subscribed to a topic in the
>Google Groups "Redis DB" group.
>To unsubscribe from this topic, visit
>https://groups.google.com/d/topic/redis-db/qpKAJl0p05E/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to

Jan-Erik Rediger

unread,
Apr 29, 2015, 2:00:28 AM4/29/15
to redi...@googlegroups.com
As I said: there is no problem. And there is no configuration error either.
It just isn't implemented. We currently don't have a field to save the
run id. It would be possible to add it to the RDB but no one did so far…

王 军飞

unread,
Apr 29, 2015, 2:13:18 AM4/29/15
to redi...@googlegroups.com
I got.

You mean I have misunderstood the partial resynchronization condition ?

The condition includes two factors “the same run id of master and the
offset is available in the replication backlog “ .by the quoted below from
redis documentation:

"Starting with Redis 2.8, master and slave are usually able to continue
the replication process without requiring a full resynchronization after
the replication link went down.This works by creating an in-memory backlog
of the replication stream on the master side. The master and all the
slaves agree on a replication offset and a master run id, so when the link
goes down, the slave will reconnect and ask the master to continue the
replication. Assuming the master run id is still the same, and that the
offset specified is available in the replication backlog, replication will
resume from the point where it left off. If either of these conditions are
unmet, a full resynchronization is performed (which is the normal pre-2.8
behavior). As the run id of the connected master is not persisted to disk,
a full resynchronization is needed when the slave restarts.
The new partial resynchronization feature uses the PSYNC command
internally, while the old implementation uses the SYNC
<http://redis.io/commands/sync> command. Note that a Redis 2.8 slave is
able to detect if the server it is talking with does not support PSYNC,
and will use SYNC <http://redis.io/commands/sync> instead.





So ,beside these two condition ,the slave need to be “alive“ ? What
"replication link went down” doesn’t mean the slave process is killed ?

Jan-Erik Rediger

unread,
Apr 29, 2015, 3:33:36 AM4/29/15
to redi...@googlegroups.com
Reply inline.

On Wed, Apr 29, 2015 at 02:12:59PM +0800, 王 军飞 wrote:
> I got.
>
> [...]

> So ,beside these two condition ,the slave need to be “alive“ ? What
> "replication link went down” doesn’t mean the slave process is killed ?

1. Yes, it needs to be alive and not be restarted, because a restart
loses state.
2. "replication link went down" means the network connection between the
master and slave was broken for a short period of time. In this case
the state is still available in the still-running slave.

johnny wong

unread,
Apr 29, 2015, 7:13:13 AM4/29/15
to redi...@googlegroups.com
Thanks

Would not it be good feature if we can save the “replication progress
information" at some place on slave server ?
And then we can do partial synchronization when slave machines rejoin the
replication after a unexpected crashed ?

Sounds it makes more sense .

Jan-Erik Rediger

unread,
Apr 29, 2015, 7:21:40 AM4/29/15
to redi...@googlegroups.com
Well, it just needs someone to correctly implement it. There's even an
issue on it afaik. ;)
Reply all
Reply to author
Forward
0 new messages