summaryrefslogtreecommitdiff
path: root/src/t_set.c
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2020-12-15 15:30:24 +0800
committerGitHub <noreply@github.com>2020-12-15 09:30:24 +0200
commit7993780dda22df01cebba42d16f805213d66e194 (patch)
treead8f584bb0f9fff5bcbbbf4ce444473945e3a69b /src/t_set.c
parent9acd40d97b00aefeae1ae8f523cd9b0adde80d81 (diff)
downloadredis-7993780dda22df01cebba42d16f805213d66e194.tar.gz
Fix some wrong server.dirty increments (#8140)
Fix wrong server dirty increment in * spopWithCountCommand * hsetCommand * ltrimCommand * pfaddCommand Some didn't increment the amount of fields (just one per command). Others had excessive increments.
Diffstat (limited to 'src/t_set.c')
-rw-r--r--src/t_set.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/t_set.c b/src/t_set.c
index 7c71dfc2f..fd9f4442a 100644
--- a/src/t_set.c
+++ b/src/t_set.c
@@ -476,7 +476,7 @@ void spopWithCountCommand(client *c) {
/* Generate an SPOP keyspace notification */
notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id);
- server.dirty += count;
+ server.dirty += (count >= size) ? size : count;
/* CASE 1:
* The number of requested elements is greater than or equal to
@@ -492,7 +492,6 @@ void spopWithCountCommand(client *c) {
/* Propagate this command as a DEL operation */
rewriteClientCommandVector(c,2,shared.del,c->argv[1]);
signalModifiedKey(c,c->db,c->argv[1]);
- server.dirty++;
return;
}
@@ -594,7 +593,6 @@ void spopWithCountCommand(client *c) {
decrRefCount(propargv[0]);
preventCommandPropagation(c);
signalModifiedKey(c,c->db,c->argv[1]);
- server.dirty++;
}
void spopCommand(client *c) {