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);
|
return lookupKeyReadWithFlags(db,key,LOOKUP_NONE);
|
||||||
} else {
|
} else {
|
||||||
// This is an async command
|
// This is an async command
|
||||||
|
if (keyIsExpired(db,key))
|
||||||
|
return nullptr;
|
||||||
int idb = db->id;
|
int idb = db->id;
|
||||||
if (serverTL->rgdbSnapshot[idb] == nullptr || serverTL->rgdbSnapshot[idb]->mvccCheckpoint() < mvccCheckpoint) {
|
if (serverTL->rgdbSnapshot[idb] == nullptr || serverTL->rgdbSnapshot[idb]->mvccCheckpoint() < mvccCheckpoint) {
|
||||||
AeLocker locker;
|
AeLocker locker;
|
||||||
@ -227,9 +229,6 @@ robj_roptr lookupKeyRead(redisDb *db, robj *key, uint64_t mvccCheckpoint) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (serverTL->rgdbSnapshot[idb] != nullptr) {
|
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