Skip to content

Commit

Permalink
Remove config option list-max-ziplist-value
Browse files Browse the repository at this point in the history
As with all config option removals, this will stop Redis
from loading any config file with that old directive.

Maybe we should allow Redis to ignore invalid directives instead
of halting and refusing to load a config file with unknown settings?
  • Loading branch information
mattsta committed Nov 18, 2014
1 parent 8b73ee1 commit 99bab4a
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 20 deletions.
11 changes: 6 additions & 5 deletions redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -814,11 +814,12 @@ notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64

# Similarly to hashes, small lists are also encoded in a special way in order
# to save a lot of space. The special representation is only used when
# you are under the following limits:
list-max-ziplist-entries 512
list-max-ziplist-value 64
# Lists are also encoded in a special way in order
# to save a lot of space. The number of entries allowed per internal
# node adjusts the memory savings vs. speed to alter internal values.
# Larger numbers of entries per node save more memory, but slightly increases
# the time it takes to insert or remove items against the list.
list-max-ziplist-entries 64

# Sets have a special encoding in just one case: when a set is composed
# of just strings that happen to be integers in radix 10 in the range
Expand Down
8 changes: 0 additions & 8 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ void loadServerConfigFromString(char *config) {
server.hash_max_ziplist_value = memtoll(argv[1], NULL);
} else if (!strcasecmp(argv[0],"list-max-ziplist-entries") && argc == 2){
server.list_max_ziplist_entries = memtoll(argv[1], NULL);
} else if (!strcasecmp(argv[0],"list-max-ziplist-value") && argc == 2) {
server.list_max_ziplist_value = memtoll(argv[1], NULL);
} else if (!strcasecmp(argv[0],"set-max-intset-entries") && argc == 2) {
server.set_max_intset_entries = memtoll(argv[1], NULL);
} else if (!strcasecmp(argv[0],"zset-max-ziplist-entries") && argc == 2) {
Expand Down Expand Up @@ -798,9 +796,6 @@ void configSetCommand(redisClient *c) {
} else if (!strcasecmp(c->argv[2]->ptr,"list-max-ziplist-entries")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
server.list_max_ziplist_entries = ll;
} else if (!strcasecmp(c->argv[2]->ptr,"list-max-ziplist-value")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
server.list_max_ziplist_value = ll;
} else if (!strcasecmp(c->argv[2]->ptr,"set-max-intset-entries")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll < 0) goto badfmt;
server.set_max_intset_entries = ll;
Expand Down Expand Up @@ -1035,8 +1030,6 @@ void configGetCommand(redisClient *c) {
server.hash_max_ziplist_value);
config_get_numerical_field("list-max-ziplist-entries",
server.list_max_ziplist_entries);
config_get_numerical_field("list-max-ziplist-value",
server.list_max_ziplist_value);
config_get_numerical_field("set-max-intset-entries",
server.set_max_intset_entries);
config_get_numerical_field("zset-max-ziplist-entries",
Expand Down Expand Up @@ -1855,7 +1848,6 @@ int rewriteConfig(char *path) {
rewriteConfigNumericalOption(state,"hash-max-ziplist-entries",server.hash_max_ziplist_entries,REDIS_HASH_MAX_ZIPLIST_ENTRIES);
rewriteConfigNumericalOption(state,"hash-max-ziplist-value",server.hash_max_ziplist_value,REDIS_HASH_MAX_ZIPLIST_VALUE);
rewriteConfigNumericalOption(state,"list-max-ziplist-entries",server.list_max_ziplist_entries,REDIS_LIST_MAX_ZIPLIST_ENTRIES);
rewriteConfigNumericalOption(state,"list-max-ziplist-value",server.list_max_ziplist_value,REDIS_LIST_MAX_ZIPLIST_VALUE);
rewriteConfigNumericalOption(state,"set-max-intset-entries",server.set_max_intset_entries,REDIS_SET_MAX_INTSET_ENTRIES);
rewriteConfigNumericalOption(state,"zset-max-ziplist-entries",server.zset_max_ziplist_entries,REDIS_ZSET_MAX_ZIPLIST_ENTRIES);
rewriteConfigNumericalOption(state,"zset-max-ziplist-value",server.zset_max_ziplist_value,REDIS_ZSET_MAX_ZIPLIST_VALUE);
Expand Down
1 change: 0 additions & 1 deletion src/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,6 @@ void initServerConfig(void) {
server.hash_max_ziplist_entries = REDIS_HASH_MAX_ZIPLIST_ENTRIES;
server.hash_max_ziplist_value = REDIS_HASH_MAX_ZIPLIST_VALUE;
server.list_max_ziplist_entries = REDIS_LIST_MAX_ZIPLIST_ENTRIES;
server.list_max_ziplist_value = REDIS_LIST_MAX_ZIPLIST_VALUE;
server.set_max_intset_entries = REDIS_SET_MAX_INTSET_ENTRIES;
server.zset_max_ziplist_entries = REDIS_ZSET_MAX_ZIPLIST_ENTRIES;
server.zset_max_ziplist_value = REDIS_ZSET_MAX_ZIPLIST_VALUE;
Expand Down
2 changes: 0 additions & 2 deletions src/redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ typedef long long mstime_t; /* millisecond time type. */
#define REDIS_HASH_MAX_ZIPLIST_ENTRIES 512
#define REDIS_HASH_MAX_ZIPLIST_VALUE 64
#define REDIS_LIST_MAX_ZIPLIST_ENTRIES 512
#define REDIS_LIST_MAX_ZIPLIST_VALUE 64
#define REDIS_SET_MAX_INTSET_ENTRIES 512
#define REDIS_ZSET_MAX_ZIPLIST_ENTRIES 128
#define REDIS_ZSET_MAX_ZIPLIST_VALUE 64
Expand Down Expand Up @@ -861,7 +860,6 @@ struct redisServer {
size_t hash_max_ziplist_entries;
size_t hash_max_ziplist_value;
size_t list_max_ziplist_entries;
size_t list_max_ziplist_value;
size_t set_max_intset_entries;
size_t zset_max_ziplist_entries;
size_t zset_max_ziplist_value;
Expand Down
1 change: 0 additions & 1 deletion tests/unit/sort.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
start_server {
tags {"sort"}
overrides {
"list-max-ziplist-value" 16
"list-max-ziplist-entries" 32
"set-max-intset-entries" 32
}
Expand Down
1 change: 0 additions & 1 deletion tests/unit/type/list-2.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
start_server {
tags {"list"}
overrides {
"list-max-ziplist-value" 16
"list-max-ziplist-entries" 4
}
} {
Expand Down
1 change: 0 additions & 1 deletion tests/unit/type/list-3.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
start_server {
tags {list ziplist}
overrides {
"list-max-ziplist-value" 200000
"list-max-ziplist-entries" 16
}
} {
Expand Down
1 change: 0 additions & 1 deletion tests/unit/type/list.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
start_server {
tags {"list"}
overrides {
"list-max-ziplist-value" 16
"list-max-ziplist-entries" 5
}
} {
Expand Down

0 comments on commit 99bab4a

Please sign in to comment.