Redis BGSAVE

456 views
Skip to first unread message

Jimson Penaflor

unread,
Mar 6, 2011, 9:39:02 AM3/6/11
to Redis DB
HI,

We currently have a master slave setup in which we have Snapshot and
AOF on master and do all saving from Slave server. The REDIS version
is currently at 2.2.1. We have noticed in the master server that from
time to time, bgsave is running even though it was not invoked. Is
this a normal behavior that BGSAVE runs occasionally even though save
is to "".

Thank you,
Jimson

Jimson Penaflor

unread,
Mar 6, 2011, 9:45:56 AM3/6/11
to Redis DB
Hi,

Sorry just wanted to make a correction. The Redis Master have both AOF
and Snapshot disabled. Sorry for the typo error.

Thanks,
Jimson

pn

unread,
Mar 7, 2011, 3:48:27 AM3/7/11
to redi...@googlegroups.com
I have to confirm this weird behavior, I'm using  2.2rc4 in a development box and definitely in that version a dump is written even when all save entries in the config file are commented out.
The config file has AOF and virtual memory turned off.

Thanks,

Paolo

Didier Spezia

unread,
Mar 7, 2011, 4:04:29 AM3/7/11
to Redis DB
Hi,

bgsave is not supposed to automatically run if you have no
save configuration.

If you have checked your configuration file does not contain
anymore any save line (you may have several of them), then
you may be in one of the following situations:

1- save lines have been removed from the conf file, but the
Redis instance has not been restarted. You can check this
by running config get save. And run config set save "" to
be sure.

2- someone or some script on your system connects to Redis
and executes bgsave commands.

Regards,
Didier.

Jimson Penaflor

unread,
Mar 7, 2011, 5:38:24 AM3/7/11
to Redis DB
hi Didier,

From running a couple of tests, one thing I noticed is that BGSAVE
runs on the Master server is SLAVE server initiates a sync process.
The test I made is as follows.

1.) Start Slave server with save options disabled and appenfsync is
set no. Only "appendonly" is set to yes to load the AOF file.
2.) Once loading is completed, I have enabled slaveof setting from
redis-cli. This initiated the sync from Slave to Master.

During initial sync process, I have noticed that Master server have
executed BGSAVE. I was able to produce the problem when I incidentally
made incorrect permission to the main Redis folder. I also noticed
that even though save is disabled from config, a dump.rdb are still
being created when Redis sync Master and Slave. Can you confirm if the
is a normal behavior.

Thanks,
Jimson

Pieter Noordhuis

unread,
Mar 7, 2011, 6:00:09 AM3/7/11
to redi...@googlegroups.com, Jimson Penaflor
Hi Jimson,

This is normal behavior, since the slave needs a dump of the master's
data set on initial SYNC. With all save directives in the
configuration disabled, this is the only time when the master creates
a dump of its dataset.

Cheers,
Pieter

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> 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.
>
>

Didier Spezia

unread,
Mar 7, 2011, 6:04:47 AM3/7/11
to Redis DB
Oops, I did not think of that case (i.e. replication).

But yes, this is the normal behavior, explained here:
http://redis.io/topics/replication

Basically, the SYNC command sent by the salve triggers
a bgsave (so a file is generated), and then this file
is transfered in bulk mode to the slave.

Regards,
Didier.

Jimson Penaflor

unread,
Mar 7, 2011, 6:08:37 AM3/7/11
to Redis DB
Thanks Didier and Pieter for the clarification.

regards,
Jimson
Reply all
Reply to author
Forward
0 new messages