Commit Graph

129 Commits

Author SHA1 Message Date
6b4d92e21d Four new persistence fields in INFO. A few renamed.
The 'persistence' section of INFO output now contains additional four
fields related to RDB and AOF persistence:

 rdb_last_bgsave_time_sec       Duration of latest BGSAVE in sec.
 rdb_current_bgsave_time_sec    Duration of current BGSAVE in sec.
 aof_last_rewrite_time_sec      Duration of latest AOF rewrite in sec.
 aof_current_rewrite_time_sec   Duration of current AOF rewrite in sec.

The 'current' fields are set to -1 if a BGSAVE / AOF rewrite is not in
progress. The 'last' fileds are set to -1 if no previous BGSAVE / AOF
rewrites were performed.

Additionally a few fields in the persistence section were renamed for
consistency:

 changes_since_last_save -> rdb_changes_since_last_save
 bgsave_in_progress -> rdb_bgsave_in_progress
 last_save_time -> rdb_last_save_time
 last_bgsave_status -> rdb_last_bgsave_status
 bgrewriteaof_in_progress -> aof_rewrite_in_progress
 bgrewriteaof_scheduled -> aof_rewrite_scheduled

After the renaming, fields in the persistence section start with rdb_ or
aof_ prefix depending on the persistence method they describe.
The field 'loading' and related fields are not prefixed because they are
unique for both the persistence methods.
2012-05-25 12:20:35 +02:00
62bfa66284 rdbLoad() should check REDIS_RDB_VERSION instead of hardcoded number. 2012-04-24 19:35:25 +02:00
39d1e350d9 It is now possible to enable/disable RDB checksum computation from redis.conf or via CONFIG SET/GET. Also CONFIG SET support added for rdbcompression as well. 2012-04-10 16:27:03 +02:00
7f4f86f427 RDB files now embed a crc64 checksum. Version of RDB bumped to 5. 2012-04-10 16:26:58 +02:00
1bcb45d118 Fixed compilation of new rio.c changes (typos and so forth.) 2012-04-10 16:26:52 +02:00
b4b923b04b Add checksum computation to rio.c 2012-04-10 16:26:45 +02:00
55951f9005 For coverage testing use exit() instead of _exit() when termiating saving children. 2012-04-08 10:43:29 +02:00
7dc1d2ba17 Removed dead code: function rdbSaveTime() is no longer used since RDB now saves expires in milliseconds. 2012-04-07 11:26:52 +02:00
11dae1711f Write RDB magic using a REDIS_RDB_VERSION define that is defined inside rdb.h 2012-04-02 13:52:42 +02:00
9b962d10a4 Fixed memory leak in hash loading. 2012-03-23 20:21:19 +01:00
a74ab6478c RDB hashes loading, fixed another bug in the loading of HT-encoded hashes: when the hash entry is too big for ziplist, add the field, then convert. The code used to break before the new entry was inserted, resulting into missing fields in the loaded Hash object. 2012-03-13 11:01:08 +01:00
ee61a4b99e RDB hashes loading fixed removing the assertion that failed every time an HT-encoded hash was loaded. 2012-03-13 09:49:21 +01:00
37180ed9cd RDB version is no 4, because small hashes are now encoded as ziplists, so older versions of Redis will not understand this format. 2012-03-10 12:35:15 +01:00
8562798308 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
c25e7eafef Refuse writes if can't persist on disk.
Redis now refuses accepting write queries if RDB persistence is
configured, but RDB snapshots can't be generated for some reason.
The status of the latest background save operation is now exposed
in the INFO output as well. This fixes issue #90.
2012-03-07 13:05:53 +01:00
cb598cdd59 Don't expire keys when loading an RDB after a SYNC
The cron is responsible for expiring keys. When keys are expired at
load time, it is possible that the snapshot of a master node gets
modified. This can in turn lead to inconsistencies in the data set.

A more concrete example of this behavior follows. A user reported a
slave that would show an monotonically increase input buffer length,
shortly after completing a SYNC. Also, `INFO` output showed a single
blocked client, which could only be the master link. Investigation
showed that indeed the `BRPOP` command was fed by the master. This
command can only end up in the stream of write operations when it did
NOT block, and effectively executed `RPOP`. However, when the key
involved in the `BRPOP` is expired BEFORE the command is executed, the
client executing it will block. The client in this case, is the master
link.
2012-02-16 17:21:13 +01:00
80586cb894 Test that zipmap from RDB is correctly converted 2012-01-25 13:28:11 -08:00
ebd85e9a45 Encode small hashes with a ziplist 2012-01-02 22:14:10 -08:00
f48cd4b90c some RDB server struct fields renamed. 2011-12-21 12:22:13 +01:00
ff2145adac more AOF server struct fields renamed. 2011-12-21 12:17:02 +01:00
4be855e757 Fixed issues with expire introduced with latest millisecond resolution feature. Many time_t were not converted to long long, and one time() call was not replaced with mstime(). 2011-11-12 01:04:27 +01:00
dab5332f95 Fixed a few typos 2011-11-09 21:59:27 +01:00
bdbdb02edb Fixed bug breaking rdbSaveMillisecondTime() in 32 bit systems. Thanks to @anydot (Přemysl Hrubý) 2011-11-09 18:47:48 +01:00
7dcc10b65e Initial support for key expire times with millisecond resolution. RDB version is now 3, new opcoded added for high resolution times. Redis is still able to correctly load RDB version 2. Tests passing but still a work in progress. API to specify milliseconds expires still missing, but the precision of normal expires is now already improved and working. 2011-11-09 16:51:19 +01:00
c0ba9ebe13 dict.c API names modified to be more coincise and consistent. 2011-11-08 17:07:55 +01:00
9e6a9f30ea A past commit removed the inclusion of redis.h from rdb.c, completely breaking 32 bit builds under Linux. 2011-10-23 10:42:16 +02:00
6d61e5bf5b Exit with Fatal error at startup if the RDB file signature or version is wrong.
Ref: issue #103
2011-10-14 16:59:38 +02:00
eab0e26e03 replaced redisAssert() with redisAssertWithInfo() in a shitload of places. 2011-10-04 18:43:03 +02:00
f96a8a8054 rioInitWithFile nad rioInitWithBuffer functions now take a rio structure pointer to avoid copying a structure to return value to the caller. 2011-09-22 16:00:40 +02:00
f9c6f39b2b merge conflicts resolved 2011-09-22 15:15:26 +02:00
c9d0c3623a diskstore removed 2011-06-25 12:22:03 +02:00
f85cd526c1 DB API refactoring. The changes were designed together with Pieter Noordhuis. 2011-06-20 16:42:16 +02:00
591f29e0f5 Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary. 2011-06-17 15:41:22 +02:00
2c6cc5e502 minor code aesthetic change 2011-06-10 18:13:57 +02:00
b333e23997 automatic AOF rewrite first implementation. Still to be tested. 2011-06-10 12:39:23 +02:00
615e414c5d INFO now contains the time (in usecs) needed to fork() in order to persist. The info is available in the stats section of INFO. 2011-05-29 15:17:29 +02:00
041d8e2a5c Fix up rdbWriteRaw to return number of bytes written 2011-05-14 12:47:42 +02:00
fd535c5862 More rioRead() 2011-05-14 12:32:50 +02:00
221782ccc6 Move rdbLoad* to top; update comments 2011-05-13 23:24:19 +02:00
f1d8e4968e Make RDB types/opcodes explicit; load/save object type 2011-05-13 22:14:39 +02:00
2e4b0e7727 Abstract file/buffer I/O to support in-memory serialization 2011-05-13 17:31:00 +02:00
6b52ad87c0 RDB version signature bumped to 2, now that direct saving of specially encoded types is implemented 2.2 instances are no longer able to read rdb files produced by 2.4 or unstable. 2011-05-10 11:31:37 +02:00
d4d3a70da2 Update target encoding for sorted set from rdb 2011-04-06 16:38:34 +02:00
100ed062c0 Test for ENCODING_SKIPLIST instead of ENCODING_RAW 2011-04-06 16:17:07 +02:00
4cc4d1648b Typo 2011-04-06 16:15:15 +02:00
7d8c555e92 Merge branch 'unstable' into unstable-zset
Conflicts:
	src/object.c
2011-04-06 16:15:01 +02:00
ecc9109434 Cluster branch merged to unstable. 2011-03-29 17:51:15 +02:00
df26a0ae0b Encode sorted set after loading from dump 2011-03-10 17:50:13 +01:00
e12b27acf7 Persistence code for encoded sorted sets 2011-03-09 13:16:38 +01:00
1213abe477 fix type in rdbSaveKeyValuePair() when saving an intset. Don't merge this commit into 2.2 as will not apply cleanly. 2011-02-28 17:55:05 +01:00