snehac-miner / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

"save 1 1" not respected (or incr not triggering save points) #112

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In redis.conf, the only save parameter I put was "save 1 1" which (unless I
am mistaken) should trigger a save point if there was one change in one
second.  I ran the following perl script:

#!usr/bin/perl

use strict;
use warnings FATAL => 'all';
use Redis;

my $r = Redis->new;

$r->set('testinc', 1);

for (my $i = 0; $i < 100000; $i++) { 
    $r->incr('testinc');
}

print $r->get('testinc')."\n";

As follows:

rlowe@hp1k:~/scratch$ date; perl test.pl; date;
Thu Nov 26 13:08:57 PST 2009
# opening socket to 127.0.0.1:6379 at /usr/share/perl5/Redis.pm line 51.
100001
Thu Nov 26 13:09:34 PST 2009
rlowe@hp1k:~/scratch$ 

During that time, here are the contents of /var/log/redis/redis-server.log

26 Nov 21:08:57 . Accepted 127.0.0.1:35646
26 Nov 21:08:57 - 1 changes in 1 seconds. Saving...
26 Nov 21:08:58 - Background saving started by pid 16129
26 Nov 21:08:59 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:08:59 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:08:59 . 1 clients connected (0 slaves), 1030911525 bytes in use
26 Nov 21:09:04 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:04 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:04 . 1 clients connected (0 slaves), 1030911527 bytes in use
26 Nov 21:09:09 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:09 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:09 . 1 clients connected (0 slaves), 1030911527 bytes in use
26 Nov 21:09:14 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:14 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:14 . 1 clients connected (0 slaves), 1030911527 bytes in use
26 Nov 21:09:19 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:19 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:19 . 1 clients connected (0 slaves), 1030911527 bytes in use
26 Nov 21:09:24 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:24 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:24 . 1 clients connected (0 slaves), 1030911451 bytes in use
26 Nov 21:09:29 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:29 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:29 . 1 clients connected (0 slaves), 1030911451 bytes in use
26 Nov 21:09:34 . DB 0: 386408 keys (0 volatile) in 524288 slots HT.
26 Nov 21:09:34 . DB 9: 2452 keys (0 volatile) in 4096 slots HT.
26 Nov 21:09:34 . 1 clients connected (0 slaves), 1030911527 bytes in use
26 Nov 21:09:34 . Client closed connection

I only see one save to disk, shouldn't I have seen one triggered every
second?  As 'testinc' was constantly being updated?

Original issue reported on code.google.com by rlowe%pa...@gtempaccount.com on 26 Nov 2009 at 9:15

GoogleCodeExporter commented 8 years ago
Hello,

tried to reproduce with the following Ruby script:

require 'rubygems'
require 'redis'
require 'digest/sha1'

r = Redis.new
r['x'] = 1
1000000000.times{
    r.incr('x')
}

Works perfectly, I see a save every second. What version of Redis are you using?
Maybe you forgot to specify the config file as argument of ./redis-server?

It is very strange. If you can give more details and double check that this 
really
what it seems I'll try to fix the bug if any.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 26 Nov 2009 at 11:06

GoogleCodeExporter commented 8 years ago
Tested again, this time with latest from Github.  Problem did not manifest 
itself, so
whatever the issue was it's fixed in the newest code.  Apologies for the false 
alarm.

Original comment by rlowe%pa...@gtempaccount.com on 27 Nov 2009 at 2:58

GoogleCodeExporter commented 8 years ago

Original comment by anti...@gmail.com on 23 Aug 2010 at 4:07