summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db.c3
-rw-r--r--src/hyperloglog.c2
-rw-r--r--src/t_hash.c2
-rw-r--r--src/t_list.c2
-rw-r--r--src/t_set.c4
5 files changed, 7 insertions, 6 deletions
diff --git a/src/db.c b/src/db.c
index 5045935c3..4f27534fc 100644
--- a/src/db.c
+++ b/src/db.c
@@ -616,6 +616,9 @@ void flushAllDataAndResetRDB(int flags) {
rdbSave(server.rdb_filename,rsiptr);
server.dirty = saved_dirty;
}
+
+ /* Without that extra dirty++, when db was already empty, FLUSHALL will
+ * not be replicated nor put into the AOF. */
server.dirty++;
#if defined(USE_JEMALLOC)
/* jemalloc 5 doesn't release pages back to the OS when there's no traffic.
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index d018e975e..648c26a02 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -1211,7 +1211,7 @@ void pfaddCommand(client *c) {
if (updated) {
signalModifiedKey(c,c->db,c->argv[1]);
notifyKeyspaceEvent(NOTIFY_STRING,"pfadd",c->argv[1],c->db->id);
- server.dirty++;
+ server.dirty += updated;
HLL_INVALIDATE_CACHE(hdr);
}
addReply(c, updated ? shared.cone : shared.czero);
diff --git a/src/t_hash.c b/src/t_hash.c
index ff9ac742e..51c7d6758 100644
--- a/src/t_hash.c
+++ b/src/t_hash.c
@@ -644,7 +644,7 @@ void hsetCommand(client *c) {
}
signalModifiedKey(c,c->db,c->argv[1]);
notifyKeyspaceEvent(NOTIFY_HASH,"hset",c->argv[1],c->db->id);
- server.dirty++;
+ server.dirty += (c->argc - 2)/2;
}
void hincrbyCommand(client *c) {
diff --git a/src/t_list.c b/src/t_list.c
index 42b4f92df..106f960f6 100644
--- a/src/t_list.c
+++ b/src/t_list.c
@@ -508,7 +508,7 @@ void ltrimCommand(client *c) {
notifyKeyspaceEvent(NOTIFY_GENERIC,"del",c->argv[1],c->db->id);
}
signalModifiedKey(c,c->db,c->argv[1]);
- server.dirty++;
+ server.dirty += (ltrim + rtrim);
addReply(c,shared.ok);
}
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) {