From 206cd219b63c2255c0238cb9c602b65f05e98120 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 8 Jan 2015 08:56:35 +0100 Subject: 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. --- src/rdb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rdb.h') 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 -- cgit v1.2.1