Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 8456e92d6e446f1cc20d9cea2328998da0a4d7d5
This commit is contained in:
commit
74c7901a5e
10
src/ae.cpp
10
src/ae.cpp
@ -403,10 +403,18 @@ extern "C" void aeDeleteEventLoop(aeEventLoop *eventLoop) {
|
||||
aeApiFree(eventLoop);
|
||||
zfree(eventLoop->events);
|
||||
zfree(eventLoop->fired);
|
||||
zfree(eventLoop);
|
||||
fastlock_free(&eventLoop->flock);
|
||||
close(eventLoop->fdCmdRead);
|
||||
close(eventLoop->fdCmdWrite);
|
||||
|
||||
auto *te = eventLoop->timeEventHead;
|
||||
while (te)
|
||||
{
|
||||
auto *teNext = te->next;
|
||||
zfree(te);
|
||||
te = teNext;
|
||||
}
|
||||
zfree(eventLoop);
|
||||
}
|
||||
|
||||
extern "C" void aeStop(aeEventLoop *eventLoop) {
|
||||
|
@ -1495,6 +1495,14 @@ void setExpire(client *c, redisDb *db, robj *key, robj *subkey, long long when)
|
||||
rememberSlaveKeyWithExpire(db,key);
|
||||
}
|
||||
|
||||
redisDb::~redisDb()
|
||||
{
|
||||
dictRelease(watched_keys);
|
||||
dictRelease(ready_keys);
|
||||
dictRelease(blocking_keys);
|
||||
listRelease(defrag_later);
|
||||
}
|
||||
|
||||
void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e)
|
||||
{
|
||||
serverAssert(GlobalLocksAcquired());
|
||||
|
@ -3849,7 +3849,7 @@ private:
|
||||
redisMaster *m_mi = nullptr;
|
||||
};
|
||||
|
||||
static thread_local ReplicaNestState *s_pstate = nullptr;
|
||||
static thread_local std::unique_ptr<ReplicaNestState> s_pstate;
|
||||
|
||||
bool FInReplicaReplay()
|
||||
{
|
||||
@ -3862,7 +3862,7 @@ static std::unordered_map<std::string, uint64_t> g_mapmvcc;
|
||||
void replicaReplayCommand(client *c)
|
||||
{
|
||||
if (s_pstate == nullptr)
|
||||
s_pstate = new (MALLOC_LOCAL) ReplicaNestState;
|
||||
s_pstate = std::make_unique<ReplicaNestState>();
|
||||
|
||||
// the replay command contains two arguments:
|
||||
// 1: The UUID of the source
|
||||
|
@ -1400,7 +1400,7 @@ public:
|
||||
/* Redis database representation. There are multiple databases identified
|
||||
* by integers from 0 (the default database) up to the max configured
|
||||
* database. The database number is the 'id' field in the structure. */
|
||||
typedef struct redisDb : public redisDbPersistentDataSnapshot
|
||||
struct redisDb : public redisDbPersistentDataSnapshot
|
||||
{
|
||||
// Legacy C API, Do not add more
|
||||
friend void tryResizeHashTables(int);
|
||||
@ -1425,6 +1425,7 @@ typedef struct redisDb : public redisDbPersistentDataSnapshot
|
||||
: expireitr(nullptr)
|
||||
{}
|
||||
void initialize(int id);
|
||||
virtual ~redisDb();
|
||||
|
||||
void dbOverwriteCore(redisDb::iter itr, robj *key, robj *val, bool fUpdateMvcc, bool fRemoveExpire);
|
||||
|
||||
@ -1477,7 +1478,7 @@ public:
|
||||
long long last_expire_set; /* when the last expire was set */
|
||||
double avg_ttl; /* Average TTL, just for stats */
|
||||
list *defrag_later; /* List of key names to attempt to defrag one by one, gradually. */
|
||||
} redisDb;
|
||||
};
|
||||
|
||||
/* Client MULTI/EXEC state */
|
||||
typedef struct multiCmd {
|
||||
|
Loading…
x
Reference in New Issue
Block a user