Unverified Commit 0f370f9b authored by Wen Hui's avatar Wen Hui Committed by GitHub
Browse files

do not add save parameter during config rewrite in sentinel mode (#7945)

Previous code would have added default redis save parameters
to the config file on rewrite, which would have been silently ignored
when the config file is loaded.

The new code avoids adding this, and also actively removes these lines
If added by a previous config rewrite. 
parent 556acefe
...@@ -1335,6 +1335,12 @@ void rewriteConfigSaveOption(struct rewriteConfigState *state) { ...@@ -1335,6 +1335,12 @@ void rewriteConfigSaveOption(struct rewriteConfigState *state) {
int j; int j;
sds line; sds line;
/* In Sentinel mode we don't need to rewrite the save parameters */
if (server.sentinel_mode) {
rewriteConfigMarkAsProcessed(state,"save");
return;
}
/* Note that if there are no save parameters at all, all the current /* Note that if there are no save parameters at all, all the current
* config line with "save" will be detected as orphaned and deleted, * config line with "save" will be detected as orphaned and deleted,
* resulting into no RDB persistence as expected. */ * resulting into no RDB persistence as expected. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment