Defrag: not enabled by default. Error on CONFIG SET if not available.

This commit is contained in:
antirez
2017-01-11 15:43:08 +01:00
parent 86192f3038
commit 6ad34a4b78
2 changed files with 11 additions and 1 deletions

View File

@ -1007,6 +1007,16 @@ void configSetCommand(client *c) {
"activerehashing",server.activerehashing) {
} config_set_bool_field(
"activedefrag",server.active_defrag_enabled) {
#ifndef HAVE_DEFRAG
if (server.active_defrag_enabled) {
server.active_defrag_enabled = 0;
addReplyError(c,
"Active defragmentation cannot be enabled: it requires a "
"Redis server compiled with a modified Jemalloc like the "
"one shipped by default with the Redis source distribution");
return;
}
#endif
} config_set_bool_field(
"protected-mode",server.protected_mode) {
} config_set_bool_field(