summaryrefslogtreecommitdiff
path: root/src/rdb.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-08 08:56:35 +0100
committerantirez <antirez@gmail.com>2015-01-08 09:52:55 +0100
commit206cd219b63c2255c0238cb9c602b65f05e98120 (patch)
treedc88e6cf08bf7a747c0584e99af2372d065d5262 /src/rdb.h
parent1a30e7ded14f4cb2ea39e05d1b1e1fd0b4d20ad6 (diff)
downloadredis-206cd219b63c2255c0238cb9c602b65f05e98120.tar.gz
RDB AUX fields support.
This commit introduces a new RDB data type called 'aux'. It is used in order to insert inside an RDB file key-value pairs that may serve different needs, without breaking backward compatibility when new informations are embedded inside an RDB file. The contract between Redis versions is to ignore unknown aux fields when encountered. Aux fields can be used in order to: 1. Augment the RDB file with info like version of Redis that created the RDB file, creation time, used memory while the RDB was created, and so forth. 2. Add state about Redis inside the RDB file that we need to reload later: replication offset, previos master run ID, in order to improve failovers safety and allow partial resynchronization after a slave restart. 3. Anything that we may want to add to RDB files without breaking the ability of past versions of Redis to load the file.
Diffstat (limited to 'src/rdb.h')
-rw-r--r--src/rdb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rdb.h b/src/rdb.h
index 99bb19abe..6319f5d02 100644
--- a/src/rdb.h
+++ b/src/rdb.h
@@ -89,6 +89,7 @@
#define rdbIsObjectType(t) ((t >= 0 && t <= 4) || (t >= 9 && t <= 14))
/* Special RDB opcodes (saved/loaded with rdbSaveType/rdbLoadType). */
+#define REDIS_RDB_OPCODE_AUX 250
#define REDIS_RDB_OPCODE_RESIZEDB 251
#define REDIS_RDB_OPCODE_EXPIRETIME_MS 252
#define REDIS_RDB_OPCODE_EXPIRETIME 253