Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
migration
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gitlab-com
migration
Commits
7fa82c21
Commit
7fa82c21
authored
Aug 06, 2018
by
Matteo Melli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shellcheck
parent
1a52a157
Pipeline
#88779
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
bin/scripts/02_failover/060_go/p04/052-check-gcp-nodes-has-same-azure-lsn.sh
...over/060_go/p04/052-check-gcp-nodes-has-same-azure-lsn.sh
+5
-0
No files found.
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
Markdown
is supported
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