Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
e8c108e9
Unverified
Commit
e8c108e9
authored
Oct 24, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Oct 24, 2018
Browse files
Merge pull request #5469 from soloestoy/stat-key-miss-if-expired
if we read a expired key, misses++
parents
a2131f90
5ddd5076
Changes
1
Show whitespace changes
Inline
Side-by-side
src/db.c
View file @
e8c108e9
...
@@ -104,7 +104,10 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
...
@@ -104,7 +104,10 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
/* Key expired. If we are in the context of a master, expireIfNeeded()
/* Key expired. If we are in the context of a master, expireIfNeeded()
* returns 0 only when the key does not exist at all, so it's safe
* returns 0 only when the key does not exist at all, so it's safe
* to return NULL ASAP. */
* to return NULL ASAP. */
if
(
server
.
masterhost
==
NULL
)
return
NULL
;
if
(
server
.
masterhost
==
NULL
)
{
server
.
stat_keyspace_misses
++
;
return
NULL
;
}
/* However if we are in the context of a slave, expireIfNeeded() will
/* However if we are in the context of a slave, expireIfNeeded() will
* not really try to expire the key, it only returns information
* not really try to expire the key, it only returns information
...
@@ -123,6 +126,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
...
@@ -123,6 +126,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
server
.
current_client
->
cmd
&&
server
.
current_client
->
cmd
&&
server
.
current_client
->
cmd
->
flags
&
CMD_READONLY
)
server
.
current_client
->
cmd
->
flags
&
CMD_READONLY
)
{
{
server
.
stat_keyspace_misses
++
;
return
NULL
;
return
NULL
;
}
}
}
}
...
...
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