"DB saved on disk" even if persistence is disabled

1,356 views
Skip to first unread message

Alexander Fortin

unread,
Feb 19, 2013, 5:01:52 AM2/19/13
to redi...@googlegroups.com
Hi folks,

we're running Redis 2.2.11 and we've noticed a strange behavior: seems
that somehow BGSAVE or similar are triggered, even if "save" is disabled
for that process:

> config get save
1) "save"
2) ""

This is part of the logfile:
...
[7659] 19 Feb 09:39:10 * DB saved on disk
[7659] 19 Feb 09:39:14 * DB saved on disk
[7659] 19 Feb 09:39:25 * DB saved on disk
[7659] 19 Feb 09:39:33 * DB saved on disk
[7659] 19 Feb 09:39:40 * DB saved on disk
...

Content of the dumped file is just "REDIS0001?", so my guess is that it
can be related to other commands we periodically run (FLUSHALL maybe?
That could explain why the dump is 10bytes)

We'd like to disable disk writes at all, so I'm wondering if we've
misconfigured something or if it's due to something else. My
understanding is that commenting out "save" statements on the redis.conf
file disables any snapshotting. Config file here:
http://pastebin.com/fB5mffmy

Thanks!

--
Alexander Fortin
https://www.vizify.com/alexander-fortin

Salvatore Sanfilippo

unread,
Feb 19, 2013, 5:14:27 AM2/19/13
to Redis DB
Exactly that, it's FLUSHALL. Upgrade to 2.6 and everything will be ok
:-) This is an old 2.2 bug.

Cheers,
Salvatore
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
— David Gelernter

Alexander Fortin

unread,
Feb 19, 2013, 5:18:19 AM2/19/13
to redi...@googlegroups.com
On 2/19/13 11:14 AM, Salvatore Sanfilippo wrote:
> Exactly that, it's FLUSHALL. Upgrade to 2.6 and everything will be ok
> :-) This is an old 2.2 bug.

Hi Salvatore, thanks for the prompt response!

Talk soon,

Arnaud GRANAL

unread,
Feb 19, 2013, 5:30:57 AM2/19/13
to redi...@googlegroups.com
On Tue, Feb 19, 2013 at 12:18 PM, Alexander Fortin <alexande...@gmail.com> wrote:
On 2/19/13 11:14 AM, Salvatore Sanfilippo wrote:
> Exactly that, it's FLUSHALL. Upgrade to 2.6 and everything will be ok
> :-) This is an old 2.2 bug.

Hi Salvatore, thanks for the prompt response!


Hi,

Otherwise if you don't want to upgrade (which I strongly advise you to) you can open db.c

void flushallCommand(redisClient *c) {
    touchWatchedKeysOnFlush(-1);
    server.dirty += emptyDb();
    addReply(c,shared.ok);
    if (server.bgsavechildpid != -1) {
        kill(server.bgsavechildpid,SIGKILL);
        rdbRemoveTempFile(server.bgsavechildpid);
    }
    rdbSave(server.dbfilename);
    server.dirty++;
}

and comment the line doing rdbSave. This might do the trick.

Arnaud. 

Salvatore Sanfilippo

unread,
Feb 19, 2013, 5:33:08 AM2/19/13
to Redis DB
Yep, the new code indeed does something like that, if save is switched
off it avoid to save the DB on disk.
It is probably trivial to adapt the flushall implementation from 2.6 to 2.2.

Salvatore

Alexander Fortin

unread,
Feb 19, 2013, 5:34:35 AM2/19/13
to redi...@googlegroups.com
On 2/19/13 11:30 AM, Arnaud GRANAL wrote:
> Hi,
>
> Otherwise if you don't want to upgrade (which I strongly advise you to)
> you can open db.c
>
> void flushallCommand(redisClient *c) {
> touchWatchedKeysOnFlush(-1);
> server.dirty += emptyDb();
> addReply(c,shared.ok);
> if (server.bgsavechildpid != -1) {
> kill(server.bgsavechildpid,SIGKILL);
> rdbRemoveTempFile(server.bgsavechildpid);
> }
> rdbSave(server.dbfilename);
> server.dirty++;
> }
>
> and comment the line doing rdbSave. This might do the trick.
>
> Arnaud.

Hi Arnaud, thanks for the suggestion. I'll upgrade eventually but if I
can quick fix it is better, do you know if the bug was already fixed in
version 2.4.15 ? That's because I've got that version already installed
and in this case it's dumb easy to do this kind of "upgrade" ;)

PS Thanks guys, this project rocks!

Alexander Fortin

unread,
Feb 19, 2013, 5:53:26 AM2/19/13
to redi...@googlegroups.com
On Tue, Feb 19, 2013 at 11:34 AM, Alexander Fortin
<alexande...@gmail.com> wrote:
> Hi Arnaud, thanks for the suggestion. I'll upgrade eventually but if I
> can quick fix it is better, do you know if the bug was already fixed in
> version 2.4.15 ? That's because I've got that version already installed
> and in this case it's dumb easy to do this kind of "upgrade" ;)

Nevermind, I've found it in release notes for 2.4 (for the records,
fixed in 2.4.1)

Cheers,

--
https://www.vizify.com/alexander-fortin
Reply all
Reply to author
Forward
0 new messages