diff options
author | antirez <antirez@gmail.com> | 2018-09-05 19:33:56 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-09-05 19:55:52 +0200 |
commit | 3e1fb5ff4cd54aa2a6a0812f00dd0177c4aeaaba (patch) | |
tree | 78655f4b42d3278a240c7db7e60c9937d4af7e77 | |
parent | c6c71abe55ef2cbd02eea389b66f4f37c69c029b (diff) | |
download | redis-3e1fb5ff4cd54aa2a6a0812f00dd0177c4aeaaba.tar.gz |
Use commands (effects) replication by default in scripts.
See issue #5250 and issue #5292 for more info.
-rw-r--r-- | src/config.c | 2 | ||||
-rw-r--r-- | src/scripting.c | 1 | ||||
-rw-r--r-- | src/server.c | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 1a64d25ed..b4c5b404a 100644 --- a/src/config.c +++ b/src/config.c @@ -677,6 +677,8 @@ void loadServerConfigFromString(char *config) { } } else if (!strcasecmp(argv[0],"lua-time-limit") && argc == 2) { server.lua_time_limit = strtoll(argv[1],NULL,10); + } else if (!strcasecmp(argv[0],"lua-replicate-commands") && argc == 2) { + server.lua_always_replicate_commands = yesnotoi(argv[1]); } else if (!strcasecmp(argv[0],"slowlog-log-slower-than") && argc == 2) { diff --git a/src/scripting.c b/src/scripting.c index 43f8d09a5..acea551ea 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -917,7 +917,6 @@ void scriptingInit(int setup) { server.lua_client = NULL; server.lua_caller = NULL; server.lua_timedout = 0; - server.lua_always_replicate_commands = 0; /* Only DEBUG can change it.*/ ldbInit(); } diff --git a/src/server.c b/src/server.c index fd8472f60..af5bef7f9 100644 --- a/src/server.c +++ b/src/server.c @@ -1715,6 +1715,12 @@ void initServerConfig(void) { server.assert_line = 0; server.bug_report_start = 0; server.watchdog_period = 0; + + /* By default we want scripts to be always replicated by effects + * (single commands executed by the script), and not by sending the + * script to the slave / AOF. This is the new way starting from + * Redis 5. However it is possible to revert it via redis.conf. */ + server.lua_always_replicate_commands = 1; } extern char **environ; |