Unverified Commit fbfdf513 authored by Meir Shpilraien (Spielrein)'s avatar Meir Shpilraien (Spielrein) Committed by GitHub
Browse files

Use `server.dirty++` instead if `forceCommandPropagation` on FUNCTION commands (#9945)

Functions are considered data, so changing a function should be counted
as a data change and should affect the persistence policy. For example
if we want to persist an RDB each minute if there was a single change,
functions should be counted as such change. Using `forceCommandPropagation`
will not give us the desired effect and so we must switch to `server.dirty++`
parent 95f943ad
...@@ -314,7 +314,9 @@ void functionsDeleteCommand(client *c) { ...@@ -314,7 +314,9 @@ void functionsDeleteCommand(client *c) {
} }
engineFunctionFree(fi, functions_ctx); engineFunctionFree(fi, functions_ctx);
forceCommandPropagation(c, PROPAGATE_REPL | PROPAGATE_AOF); /* Indicate that the command changed the data so it will be replicated and
* counted as a data change (for persistence configuration) */
server.dirty++;
addReply(c, shared.ok); addReply(c, shared.ok);
} }
...@@ -484,7 +486,9 @@ void functionsCreateCommand(client *c) { ...@@ -484,7 +486,9 @@ void functionsCreateCommand(client *c) {
addReplyErrorSds(c, err); addReplyErrorSds(c, err);
return; return;
} }
forceCommandPropagation(c, PROPAGATE_REPL | PROPAGATE_AOF); /* Indicate that the command changed the data so it will be replicated and
* counted as a data change (for persistence configuration) */
server.dirty++;
addReply(c, shared.ok); addReply(c, shared.ok);
} }
......
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