Re: Redis Replication DBSIZE Mismatch?

62 views
Skip to first unread message

Josiah Carlson

unread,
Aug 19, 2012, 3:38:01 PM8/19/12
to redi...@googlegroups.com
First, restarting the slave from a dump won't help you get more keys
into the slave. The slave will have its entire database reset the
moment it starts being a slave of the master.

To answer your actual question; do you have keys with expiration on
the master? If so, it is very likely that some portion of your keys
could be expired, but haven't been. When the master forks to save a
dump for the slave, the forked child discards any expired keys, and
sends the result to the slave. These changes don't propagate to the
master, because of the way 'fork' works.

Regards,
- Josiah

On Fri, Aug 17, 2012 at 8:29 AM, Max H <m...@kapamaki.net> wrote:
> Hey Redis list,
>
> Sorry if I've missed something obvious. Yesterday I set up a redis slave for
> my master, because I was unhappy with the occasional errors I was seeing
> client-side (which I believe were related to redis hiccuping during bgsave
> forking on AWS). Replication seems to be working fine, no errors, and keys
> created on the master seem to appear on the slave faster than I can check by
> hand.
>
> The problem is the number of keys that each server reports is off by about
> 3% or so. For example. my master is currently reporting 4,940,878 keys, and
> my slave is reporting 4,797,711 keys. Shouldn't these numbers be somewhat
> identical? Also, the master is using 7200MB RAM but the slave is only using
> 4737MB.
>
> I have no idea how to see what's missing from the slave, short of a full key
> scan. Almost all the keys are set to expire at some point. Master is 2.4.11
> up for 63 days, slave is 2.5.12 from yesterday. client_longest_output_list
> on the master is 0.
>
> Any idea what's going on? Should I manually copy over the rdb from the
> master and restart the slave from that?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/4lJ7pdUP9_cJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.
Reply all
Reply to author
Forward
0 new messages