summaryrefslogtreecommitdiff
path: root/src/redismodule.h
diff options
context:
space:
mode:
authorchenyang8094 <chenyang8094@users.noreply.github.com>2022-01-13 14:49:26 +0800
committerGitHub <noreply@github.com>2022-01-13 08:49:26 +0200
commite9bff7978a4e4b5cc7ab958715d1a6214dc68919 (patch)
treed4be16b9cd4fe3b85375bf5c78a754c5d08f6373 /src/redismodule.h
parent20c33fe6a8fce2edb3e4158bc10bde2c3740a25b (diff)
downloadredis-e9bff7978a4e4b5cc7ab958715d1a6214dc68919.tar.gz
Always create base AOF file when redis start from empty. (#10102)
Force create a BASE file (use a foreground `rewriteAppendOnlyFile`) when redis starts from an empty data set and `appendonly` is yes. The reasoning is that normally, after redis is running for some time, and the AOF has gone though a few rewrites, there's always a base rdb file. and the scenario where the base file is missing, is kinda rare (happens only at empty startup), so this change normalizes it. But more importantly, there are or could be some complex modules that are started with some configuration, when they create persistence they write that configuration to RDB AUX fields, so that can can always know with which configuration the persistence file they're loading was created (could be critical). there is (was) one scenario in which they could load their persisted data, and that configuration was missing, and this change fixes it. Add a new module event: REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_AOF_START, similar to REDISMODULE_SUBEVENT_PERSISTENCE_AOF_START which is async. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/redismodule.h')
-rw-r--r--src/redismodule.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/redismodule.h b/src/redismodule.h
index 16c7950d4..0f8ab6fb2 100644
--- a/src/redismodule.h
+++ b/src/redismodule.h
@@ -383,7 +383,8 @@ static const RedisModuleEvent
#define REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_RDB_START 2
#define REDISMODULE_SUBEVENT_PERSISTENCE_ENDED 3
#define REDISMODULE_SUBEVENT_PERSISTENCE_FAILED 4
-#define _REDISMODULE_SUBEVENT_PERSISTENCE_NEXT 5
+#define REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_AOF_START 5
+#define _REDISMODULE_SUBEVENT_PERSISTENCE_NEXT 6
#define REDISMODULE_SUBEVENT_LOADING_RDB_START 0
#define REDISMODULE_SUBEVENT_LOADING_AOF_START 1