Skip to content

Commit

Permalink
Add log about old primary after myself failover
Browse files Browse the repository at this point in the history
Sometims it is hard to see the old primary during a
multi primaries failover, adding this log can help
use to find the old primary node.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Sep 20, 2024
1 parent 56fd977 commit e8ba984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4476,7 +4476,9 @@ void clusterFailoverReplaceYourPrimary(void) {

if (clusterNodeIsPrimary(myself) || old_primary == NULL) return;

/* 1) Turn this node into a primary . */
serverLog(LL_NOTICE, "Setting myself to primary after failover, my old primary is %.40s", old_primary->name);

/* 1) Turn this node into a primary. */
clusterSetNodeAsPrimary(myself);
replicationUnsetPrimary();

Expand Down

0 comments on commit e8ba984

Please sign in to comment.