From 349d9d2c05631e0dd38c2477272dd8f3e09e25f1 Mon Sep 17 00:00:00 2001 From: VivekSainiEQ Date: Wed, 27 Oct 2021 17:08:37 +0000 Subject: [PATCH] Cast pointer correctly and fixed MVCC not updating correctly Former-commit-id: 79bdcf0b3d0c190a24e6b7da50ce05f4e5185d04 --- src/ae_kqueue.c | 2 +- src/rdb.cpp | 1 + src/server.cpp | 7 ++----- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ae_kqueue.c b/src/ae_kqueue.c index 182635a76..e1d09e7e6 100644 --- a/src/ae_kqueue.c +++ b/src/ae_kqueue.c @@ -75,7 +75,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) { return -1; } anetCloexec(state->kqfd); - state->eventsMask = zmalloc(EVENT_MASK_MALLOC_SIZE(eventLoop->setsize), MALLOC_LOCAL); + state->eventsMask = (char*)zmalloc(EVENT_MASK_MALLOC_SIZE(eventLoop->setsize), MALLOC_LOCAL); memset(state->eventsMask, 0, EVENT_MASK_MALLOC_SIZE(eventLoop->setsize)); eventLoop->apidata = state; return 0; diff --git a/src/rdb.cpp b/src/rdb.cpp index 2e96aa3ac..dfeaaa54b 100644 --- a/src/rdb.cpp +++ b/src/rdb.cpp @@ -2798,6 +2798,7 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) { key = nullptr; } else { sdsfree(key); + key = nullptr; goto eoferr; } } else { diff --git a/src/server.cpp b/src/server.cpp index ebdb987e7..7dc38179a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4004,12 +4004,9 @@ void call(client *c, int flags) { /* Call the command. */ dirty = g_pserver->dirty; prev_err_count = g_pserver->stat_total_error_replies; + g_pserver->fixed_time_expire++; - /* Update cache time, in case we have nested calls we want to - * update only on the first call*/ - if (g_pserver->fixed_time_expire++ == 0) { - updateCachedTime(0); - } + updateCachedTime(0); incrementMvccTstamp(); elapsedStart(&call_timer); try {