make keyIsExpired check earlier on async read
Former-commit-id: 32dbfbb3a69681553b65afa2d05ea47058833550
This commit is contained in:
parent
3857c65dd9
commit
2e5c69f2d8
@ -214,6 +214,8 @@ robj_roptr lookupKeyRead(redisDb *db, robj *key, uint64_t mvccCheckpoint) {
|
||||
return lookupKeyReadWithFlags(db,key,LOOKUP_NONE);
|
||||
} else {
|
||||
// This is an async command
|
||||
if (keyIsExpired(db,key))
|
||||
return nullptr;
|
||||
int idb = db->id;
|
||||
if (serverTL->rgdbSnapshot[idb] == nullptr || serverTL->rgdbSnapshot[idb]->mvccCheckpoint() < mvccCheckpoint) {
|
||||
AeLocker locker;
|
||||
@ -227,10 +229,7 @@ robj_roptr lookupKeyRead(redisDb *db, robj *key, uint64_t mvccCheckpoint) {
|
||||
}
|
||||
}
|
||||
if (serverTL->rgdbSnapshot[idb] != nullptr) {
|
||||
if (keyIsExpired(serverTL->rgdbSnapshot[idb],key))
|
||||
o = nullptr;
|
||||
else
|
||||
o = serverTL->rgdbSnapshot[idb]->find_cached_threadsafe(szFromObj(key)).val();
|
||||
o = serverTL->rgdbSnapshot[idb]->find_cached_threadsafe(szFromObj(key)).val();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user