summaryrefslogtreecommitdiff
path: root/src/module.c
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/module.c
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/module.c')
-rw-r--r--src/module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index 36c4202c5..6cc9c2b0e 100644
--- a/src/module.c
+++ b/src/module.c
@@ -9046,6 +9046,7 @@ static uint64_t moduleEventVersions[] = {
* * `REDISMODULE_SUBEVENT_PERSISTENCE_RDB_START`
* * `REDISMODULE_SUBEVENT_PERSISTENCE_AOF_START`
* * `REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_RDB_START`
+ * * `REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_AOF_START`
* * `REDISMODULE_SUBEVENT_PERSISTENCE_ENDED`
* * `REDISMODULE_SUBEVENT_PERSISTENCE_FAILED`
*