mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
RDB: clarify a condition in rdbLoadRio().
This commit is contained in:
parent
30adc62232
commit
3d5b2d41b5
10
src/rdb.c
10
src/rdb.c
@ -2231,8 +2231,14 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
|
|||||||
* an RDB file from disk, either at startup, or when an RDB was
|
* an RDB file from disk, either at startup, or when an RDB was
|
||||||
* received from the master. In the latter case, the master is
|
* received from the master. In the latter case, the master is
|
||||||
* responsible for key expiry. If we would expire keys here, the
|
* responsible for key expiry. If we would expire keys here, the
|
||||||
* snapshot taken by the master may not be reflected on the slave. */
|
* snapshot taken by the master may not be reflected on the slave.
|
||||||
if (iAmMaster() && !(rdbflags&RDBFLAGS_AOF_PREAMBLE) && expiretime != -1 && expiretime < now) {
|
* Similarly if the RDB is the preamble of an AOF file, we want to
|
||||||
|
* load all the keys as they are, since the log of operations later
|
||||||
|
* assume to work in an exact keyspace state. */
|
||||||
|
if (iAmMaster() &&
|
||||||
|
!(rdbflags&RDBFLAGS_AOF_PREAMBLE) &&
|
||||||
|
expiretime != -1 && expiretime < now)
|
||||||
|
{
|
||||||
sdsfree(key);
|
sdsfree(key);
|
||||||
decrRefCount(val);
|
decrRefCount(val);
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,6 +125,7 @@
|
|||||||
#define RDBFLAGS_NONE 0
|
#define RDBFLAGS_NONE 0
|
||||||
#define RDBFLAGS_AOF_PREAMBLE (1<<0)
|
#define RDBFLAGS_AOF_PREAMBLE (1<<0)
|
||||||
#define RDBFLAGS_REPLICATION (1<<1)
|
#define RDBFLAGS_REPLICATION (1<<1)
|
||||||
|
#define RDBFLAGS_ALLOW_DUP (1<<2)
|
||||||
|
|
||||||
int rdbSaveType(rio *rdb, unsigned char type);
|
int rdbSaveType(rio *rdb, unsigned char type);
|
||||||
int rdbLoadType(rio *rdb);
|
int rdbLoadType(rio *rdb);
|
||||||
|
Loading…
Reference in New Issue
Block a user