Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gitlab-com
migration
Commits
7fa82c21
Commit
7fa82c21
authored
Aug 06, 2018
by
Matteo Melli
Browse files
Shellcheck
parent
1a52a157
Pipeline
#88779
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bin/scripts/02_failover/060_go/p04/052-check-gcp-nodes-has-same-azure-lsn.sh
View file @
7fa82c21
...
...
@@ -5,18 +5,23 @@ set -eu
# shellcheck source=/dev/null
source
"
${
BASE
}
/env_
${
ENVIRONMENT
}
"
# shellcheck disable=SC2030,SC2031,SC2036,SC2116
azure_master_lsn
=
"
$(
echo
"select case when pg_is_in_recovery()
then pg_last_xlog_replay_location()
else pg_current_xlog_location() end;"
)
"
\
| ssh_remote
"
$AZURE_MASTER
"
sudo
-u
gitlab-psql gitlab-psql
-d
postgres
-t
-A
# shellcheck disable=SC2030,SC2031,SC2036,SC2116
gcp_master_candidate_lsn
=
"
$(
echo
"select case when pg_is_in_recovery()
then pg_last_xlog_replay_location()
else pg_current_xlog_location() end;"
\
| ssh_remote
"
$GCP_MASTER_CANDIDATE
"
sudo
-u
gitlab-psql gitlab-psql
-d
postgres
-t
-A
)
"
# shellcheck disable=SC2030,SC2031
if
[
"
$azure_master_lsn
"
==
"
$gcp_master_candidate_lsn
"
]
then
# shellcheck disable=SC2030,SC2031
echo
"GCP and Azure have same LSN:
$azure_master_lsn
"
exit
0
fi
# shellcheck disable=SC2030,SC2031
echo
"GCP and Azure have NOT same LSN. Current LSNs are: Azure/
$azure_master_lsn
GCP/
$gcp_master_candidate_lsn
"
exit
1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment