summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-04-06 17:27:39 +0200
committerGitHub <noreply@github.com>2020-04-06 17:27:39 +0200
commit094b47391de9ce83a6217e993e4da3f3d10edb7e (patch)
tree9d0393e71e1523af73232f5bc5424d67609bdd29
parent121c51f4f338dcb160398c3254024867807aa112 (diff)
parent3c0ed0309ac5bae52464ecb45e92056e212f2b7f (diff)
downloadredis-094b47391de9ce83a6217e993e4da3f3d10edb7e.tar.gz
Merge pull request #6243 from soloestoy/expand-lazy-free-server-del
lazyfree: add a new configuration lazyfree-lazy-user-del
-rw-r--r--redis.conf5
-rw-r--r--src/config.c1
-rw-r--r--src/db.c2
-rw-r--r--src/server.h1
4 files changed, 7 insertions, 2 deletions
diff --git a/redis.conf b/redis.conf
index 7c55a3ab0..14388e320 100644
--- a/redis.conf
+++ b/redis.conf
@@ -936,7 +936,9 @@ replica-priority 100
# or SORT with STORE option may delete existing keys. The SET command
# itself removes any old content of the specified key in order to replace
# it with the specified string.
-# 4) During replication, when a replica performs a full resynchronization with
+# 4) The DEL command itself, and normally it's not easy to replace DEL with
+# UNLINK in user's codes.
+# 5) During replication, when a replica performs a full resynchronization with
# its master, the content of the whole database is removed in order to
# load the RDB file just transferred.
#
@@ -948,6 +950,7 @@ replica-priority 100
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
+lazyfree-lazy-user-del no
replica-lazy-flush no
################################ THREADED I/O #################################
diff --git a/src/config.c b/src/config.c
index 7c87ebe6e..e0cbcc281 100644
--- a/src/config.c
+++ b/src/config.c
@@ -2099,6 +2099,7 @@ standardConfig configs[] = {
createBoolConfig("lazyfree-lazy-eviction", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_eviction, 0, NULL, NULL),
createBoolConfig("lazyfree-lazy-expire", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_expire, 0, NULL, NULL),
createBoolConfig("lazyfree-lazy-server-del", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_server_del, 0, NULL, NULL),
+ createBoolConfig("lazyfree-lazy-user-del", NULL, MODIFIABLE_CONFIG, server.lazyfree_lazy_user_del , 0, NULL, NULL),
createBoolConfig("repl-disable-tcp-nodelay", NULL, MODIFIABLE_CONFIG, server.repl_disable_tcp_nodelay, 0, NULL, NULL),
createBoolConfig("repl-diskless-sync", NULL, MODIFIABLE_CONFIG, server.repl_diskless_sync, 0, NULL, NULL),
createBoolConfig("gopher-enabled", NULL, MODIFIABLE_CONFIG, server.gopher_enabled, 0, NULL, NULL),
diff --git a/src/db.c b/src/db.c
index 6e5a8bf3a..9b5d62f29 100644
--- a/src/db.c
+++ b/src/db.c
@@ -556,7 +556,7 @@ void delGenericCommand(client *c, int lazy) {
}
void delCommand(client *c) {
- delGenericCommand(c,0);
+ delGenericCommand(c,server.lazyfree_lazy_user_del);
}
void unlinkCommand(client *c) {
diff --git a/src/server.h b/src/server.h
index b17995948..9b77f55ac 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1397,6 +1397,7 @@ struct redisServer {
int lazyfree_lazy_eviction;
int lazyfree_lazy_expire;
int lazyfree_lazy_server_del;
+ int lazyfree_lazy_user_del;
/* Latency monitor */
long long latency_monitor_threshold;
dict *latency_events;