Skip to content

Commit

Permalink
fix: Prevent replication setup after master promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Dec 18, 2024
1 parent 145102d commit 70ede5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mysql-role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1102,13 +1102,13 @@ validate_master_info() {
if [ "$master_id" = "$NODE_ID" ]; then
if [ "$CURRENT_ROLE" != "master" ]; then
log_info "We should be master - initiating promotion"
if handle_promotion_to_master; then
log_info "Successfully promoted to master, skipping replication setup"
return 0
else
if ! handle_promotion_to_master; then
log_error "Failed to promote to master"
return 1
fi
# Return immediately after successful promotion
log_info "Successfully promoted to master, skipping further validation"
return 0
fi
log_info "We are already the master node"
return 0
Expand Down

0 comments on commit 70ede5f

Please sign in to comment.