Skip to content

Commit

Permalink
add judge primary ip itself
Browse files Browse the repository at this point in the history
Add a function to determine whether the obtained master node IP is itself

Signed-off-by: kwen <38367518+kwenzh@users.noreply.github.com>
  • Loading branch information
kwenzh authored May 31, 2024
1 parent ba1cc68 commit 64d63cd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,12 @@ repmgr_get_primary_node() {
primary_port="$REPMGR_PRIMARY_PORT"
fi
else
primary_host="$upstream_host"
primary_port="$upstream_port"
if [[ "${upstream_host}:${upstream_port}" = "${REPMGR_NODE_NETWORK_NAME}:${REPMGR_PORT_NUMBER}" ]]; then
info "Skip Primary Ip self. Starting PostgreSQL normally..."
else
primary_host="$upstream_host"
primary_port="$upstream_port"
fi
fi
fi
Expand Down

0 comments on commit 64d63cd

Please sign in to comment.