mirror of
https://github.com/fluencelabs/redis
synced 2025-05-20 14:11:20 +00:00
Fix CONFIG REWRITE handling of unknown options.
There were two problems with the implementation. 1) "save" was not correctly processed when no save point was configured, as reported in issue #1416. 2) The way the code checked if an option existed in the "processed" dictionary was wrong, as we add the element with as a key associated with a NULL value, so dictFetchValue() can't be used to check for existance, but dictFind() must be used, that returns NULL only if the entry does not exist at all.
This commit is contained in:
parent
c6db326d1d
commit
4ad219adc8
@ -1416,6 +1416,8 @@ void rewriteConfigSaveOption(struct rewriteConfigState *state) {
|
|||||||
server.saveparams[j].seconds, server.saveparams[j].changes);
|
server.saveparams[j].seconds, server.saveparams[j].changes);
|
||||||
rewriteConfigRewriteLine(state,"save",line,1);
|
rewriteConfigRewriteLine(state,"save",line,1);
|
||||||
}
|
}
|
||||||
|
/* Mark "save" as processed in case server.saveparamslen is zero. */
|
||||||
|
rewriteConfigMarkAsProcessed(state,"save");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rewrite the dir option, always using absolute paths.*/
|
/* Rewrite the dir option, always using absolute paths.*/
|
||||||
@ -1554,7 +1556,7 @@ void rewriteConfigRemoveOrphaned(struct rewriteConfigState *state) {
|
|||||||
|
|
||||||
/* Don't blank lines about options the rewrite process
|
/* Don't blank lines about options the rewrite process
|
||||||
* don't understand. */
|
* don't understand. */
|
||||||
if (dictFetchValue(state->rewritten,option) == NULL) {
|
if (dictFind(state->rewritten,option) == NULL) {
|
||||||
redisLog(REDIS_DEBUG,"Not rewritten option: %s", option);
|
redisLog(REDIS_DEBUG,"Not rewritten option: %s", option);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user