Skip to content

Commit

Permalink
fix(issue): ensure that most recent replica_host is treated as master…
Browse files Browse the repository at this point in the history
… for sysown#3962
  • Loading branch information
Levence committed Sep 1, 2022
1 parent 3a590ba commit 346cb4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MySQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4466,7 +4466,7 @@ void * monitor_AWS_Aurora_thread_HG(void *arg) {
"SELECT SERVER_ID,"
"IF("
"SESSION_ID = 'MASTER_SESSION_ID' AND "
"SERVER_ID <> (SELECT SERVER_ID FROM INFORMATION_SCHEMA.REPLICA_HOST_STATUS WHERE SESSION_ID = 'MASTER_SESSION_ID' ORDER BY LAST_UPDATE_TIMESTAMP ASC LIMIT 1), "
"SERVER_ID <> (SELECT SERVER_ID FROM INFORMATION_SCHEMA.REPLICA_HOST_STATUS WHERE SESSION_ID = 'MASTER_SESSION_ID' ORDER BY LAST_UPDATE_TIMESTAMP DESC LIMIT 1), "
"'probably_former_MASTER_SESSION_ID', SESSION_ID"
") SESSION_ID, " // it seems that during a failover, the old writer can keep MASTER_SESSION_ID because not updated
"LAST_UPDATE_TIMESTAMP, "
Expand Down

0 comments on commit 346cb4b

Please sign in to comment.