Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
cd109e8e
Commit
cd109e8e
authored
Apr 05, 2023
by
Vitaly Arbuzov
Browse files
Remove cluster mode checks surrounding cumulativeKeyCountAdd
parent
7fe71894
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
cd109e8e
...
...
@@ -234,9 +234,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
serverAssertWithInfo
(
NULL
,
key
,
de
!=
NULL
);
dictSetVal
(
d
,
de
,
val
);
db
->
key_count
++
;
if
(
server
.
cluster_enabled
)
{
cumulativeKeyCountAdd
(
db
,
slot
,
1
);
}
cumulativeKeyCountAdd
(
db
,
slot
,
1
);
signalKeyAsReady
(
db
,
key
,
val
->
type
);
notifyKeyspaceEvent
(
NOTIFY_NEW
,
"new"
,
key
,
db
->
id
);
}
...
...
@@ -270,9 +268,7 @@ int dbAddRDBLoad(redisDb *db, sds key, robj *val) {
if
(
de
==
NULL
)
return
0
;
dictSetVal
(
d
,
de
,
val
);
db
->
key_count
++
;
if
(
server
.
cluster_enabled
)
{
cumulativeKeyCountAdd
(
db
,
slot
,
1
);
}
cumulativeKeyCountAdd
(
db
,
slot
,
1
);
return
1
;
}
...
...
@@ -490,9 +486,7 @@ int dbGenericDelete(redisDb *db, robj *key, int async, int flags) {
* the key, because it is shared with the main dictionary. */
if
(
dictSize
(
db
->
expires
)
>
0
)
dictDelete
(
db
->
expires
,
key
->
ptr
);
dictTwoPhaseUnlinkFree
(
d
,
de
,
plink
,
table
);
if
(
server
.
cluster_enabled
)
{
cumulativeKeyCountAdd
(
db
,
slot
,
-
1
);
}
cumulativeKeyCountAdd
(
db
,
slot
,
-
1
);
db
->
key_count
--
;
return
1
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment