Skip to content

Commit e13a90a

Browse files
author
gd.zhou
committed
[hotfix] server.current_client reset old client when exec call function after
1 parent 5b9b86f commit e13a90a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ctrip_swap_repl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void processFinishedReplCommands() {
176176
listDelNode(server.swap_repl_worker_clients_used, ln);
177177

178178
serverAssert(c->flags&CLIENT_MASTER);
179-
179+
client* old_client = server.current_client;
180180
backup_cmd = c->cmd;
181181
c->cmd = wc->cmd;
182182
server.current_client = c;
@@ -241,7 +241,7 @@ static void processFinishedReplCommands() {
241241
}
242242

243243
if (gtid_repr) decrRefCount(gtid_repr);
244-
244+
server.current_client = old_client;
245245
clientReleaseLocks(wc,NULL/*ctx unused*/);
246246

247247
/* Mark this repl command as fully finished only after:

src/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6245,7 +6245,7 @@ dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, i
62456245
#ifdef ENABLE_SWAP
62466246
char *default_sections[] = {
62476247
"server", "clients", "memory", "persistence", "stats", "replication", "threads",
6248-
"cpu", "module_list", "errorstats", "cluster", "keyspace", "keysizes", "swap", "swap.scanexpire", "rocksdb", NULL};
6248+
"cpu", "module_list", "errorstats", "cluster", "keyspace", "keysizes", "gtid", "swap", "swap.scanexpire", "rocksdb", NULL};
62496249
#else
62506250
char *default_sections[] = {
62516251
"server", "clients", "memory", "persistence", "stats", "replication", "threads",

0 commit comments

Comments
 (0)