It does not keep a copy of the previous state at all.
> the number of keys returned by "info" should remain unchanged until
> the sync is done.
You can monitor the info command to watch for when the slave is done
syncing (there is a specific info field that I can't remember right
now that tells you when it is ready).
Regards,
- Josiah
If it's taking 30 minutes to load your data, it sounds like a
potential network issue. It used to take us 15 minutes to load a Redis
database that was 45 gigs in memory from a local disk (it had about
300 million items of various types and sizes).
Also, 30 minutes to load the data across the network, and you are
having issues that lead to Redis disconnecting... it sounds to me like
the network between your machines may not be great. Is it
multi-datacenter? Have you done long-term connectivity tests? How big
is your dump.rdb on the master?
> Is there a way to disable Redis' synchronization when reconnecting to
> master? I would rather risk outdated information than the current
> behaviour.
You mean, is there any way to prevent Redis from dropping the old data
it has in memory before loading the new dump from the master? No.
There is no way. It was discussed before, but it was ultimately
rejected because the memory doubling would be confusing to other
users.
One thing you could do is if your clients make a read request against
a slave, and that is missing data, you could hit the master. If you
are in the same datacenter, that shouldn't be too bad, as hopefully
your slaves aren't down very often. If it is multi-datacenter, then
you have other problems.
If you are multi-datacenter, you may want to consider using OpenVPN to
bridge the two (or more) datacenters. On the one hand, it will be a
bit slower. On the other hand, OpenVPN does some other stuff that
keeps connections open even in some nasty scenarios. For example, I've
created OpenVPN connections from California through Texas (Rackspace)
to Virginia (EC2). I suspend my computer, drive 45 minutes home, and
bring my computer back up. Once my computer gets DHCP again at home,
2-3 seconds later I am left with the same blinking prompt and console
that I had when I left work.
Regards,
- Josiah