MVCC Perf fixes
Former-commit-id: 5a4afe5fb4231bec34d434f9e3214a7320842091
This commit is contained in:
parent
3c1e63fa74
commit
85d7a4c1e2
@ -101,7 +101,12 @@ static robj* lookupKey(redisDb *db, robj *key, int flags) {
|
|||||||
}
|
}
|
||||||
static robj_roptr lookupKeyConst(redisDb *db, robj *key, int flags) {
|
static robj_roptr lookupKeyConst(redisDb *db, robj *key, int flags) {
|
||||||
serverAssert((flags & LOOKUP_UPDATEMVCC) == 0);
|
serverAssert((flags & LOOKUP_UPDATEMVCC) == 0);
|
||||||
robj_roptr val = db->find(szFromObj(key));
|
robj_roptr val;
|
||||||
|
if (g_pserver->m_pstorageFactory)
|
||||||
|
val = db->find(szFromObj(key)).val();
|
||||||
|
else
|
||||||
|
val = db->find_cached_threadsafe(szFromObj(key)).val();
|
||||||
|
|
||||||
if (val != nullptr) {
|
if (val != nullptr) {
|
||||||
lookupKeyUpdateObj(val.unsafe_robjcast(), flags);
|
lookupKeyUpdateObj(val.unsafe_robjcast(), flags);
|
||||||
return val;
|
return val;
|
||||||
@ -2333,10 +2338,12 @@ bool redisDbPersistentData::insert(char *key, robj *o, bool fAssumeNew)
|
|||||||
serverAssert(FImplies(fAssumeNew, res == DICT_OK));
|
serverAssert(FImplies(fAssumeNew, res == DICT_OK));
|
||||||
if (res == DICT_OK)
|
if (res == DICT_OK)
|
||||||
{
|
{
|
||||||
|
#ifdef CHECKED_BUILD
|
||||||
if (m_pdbSnapshot != nullptr && m_pdbSnapshot->find_cached_threadsafe(key) != nullptr)
|
if (m_pdbSnapshot != nullptr && m_pdbSnapshot->find_cached_threadsafe(key) != nullptr)
|
||||||
{
|
{
|
||||||
serverAssert(dictFind(m_pdictTombstone, key) != nullptr);
|
serverAssert(dictFind(m_pdictTombstone, key) != nullptr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
trackkey(key, false /* fUpdate */);
|
trackkey(key, false /* fUpdate */);
|
||||||
}
|
}
|
||||||
return (res == DICT_OK);
|
return (res == DICT_OK);
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef __STORAGE_H__
|
#ifndef __STORAGE_H__
|
||||||
#define __STORAGE_H__
|
#define __STORAGE_H__
|
||||||
|
|
||||||
#define OBJ_ENCODING_EMBSTR_SIZE_LIMIT 48 // Note: also defined in object.c - should always match
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user