diff options
author | antirez <antirez@gmail.com> | 2014-09-08 09:23:55 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-09-08 10:56:52 +0200 |
commit | 31f79a46ffbf04d372cfc0ebfcc5578daf39c532 (patch) | |
tree | e661a4f97457db73b71cad209251cb1fc683ee99 /src | |
parent | de663966c64e9f27e667ad6a0dacf66aaa8ad32e (diff) | |
download | redis-31f79a46ffbf04d372cfc0ebfcc5578daf39c532.tar.gz |
Make aof-load-truncated option actually configurable.
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 976c8e8b7..e699a7e54 100644 --- a/src/config.c +++ b/src/config.c @@ -358,7 +358,12 @@ void loadServerConfigFromString(char *config) { } else if (!strcasecmp(argv[0],"aof-rewrite-incremental-fsync") && argc == 2) { - if ((server.aof_rewrite_incremental_fsync = yesnotoi(argv[1])) == -1) { + if ((server.aof_rewrite_incremental_fsync = + yesnotoi(argv[1])) == -1) { + err = "argument must be 'yes' or 'no'"; goto loaderr; + } + } else if (!strcasecmp(argv[0],"aof-load-truncated") && argc == 2) { + if ((server.aof_load_truncated = yesnotoi(argv[1])) == -1) { err = "argument must be 'yes' or 'no'"; goto loaderr; } } else if (!strcasecmp(argv[0],"requirepass") && argc == 2) { @@ -713,6 +718,11 @@ void configSetCommand(redisClient *c) { if (yn == -1) goto badfmt; server.aof_rewrite_incremental_fsync = yn; + } else if (!strcasecmp(c->argv[2]->ptr,"aof-load-truncated")) { + int yn = yesnotoi(o->ptr); + + if (yn == -1) goto badfmt; + server.aof_load_truncated = yn; } else if (!strcasecmp(c->argv[2]->ptr,"save")) { int vlen, j; sds *v = sdssplitlen(o->ptr,sdslen(o->ptr)," ",1,&vlen); @@ -1045,6 +1055,8 @@ void configGetCommand(redisClient *c) { server.repl_disable_tcp_nodelay); config_get_bool_field("aof-rewrite-incremental-fsync", server.aof_rewrite_incremental_fsync); + config_get_bool_field("aof-load-truncated", + server.aof_load_truncated); /* Everything we can't handle with macros follows. */ @@ -1813,6 +1825,7 @@ int rewriteConfig(char *path) { rewriteConfigClientoutputbufferlimitOption(state); rewriteConfigNumericalOption(state,"hz",server.hz,REDIS_DEFAULT_HZ); rewriteConfigYesNoOption(state,"aof-rewrite-incremental-fsync",server.aof_rewrite_incremental_fsync,REDIS_DEFAULT_AOF_REWRITE_INCREMENTAL_FSYNC); + rewriteConfigYesNoOption(state,"aof-load-truncated",server.aof_load_truncated,REDIS_DEFAULT_AOF_LOAD_TRUNCATED); if (server.sentinel_mode) rewriteConfigSentinelOption(state); /* Step 3: remove all the orphaned lines in the old file, that is, lines |