Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
nexedi
MariaDB
Commits
4cb73f49
Commit
4cb73f49
authored
Sep 10, 2024
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
galera SST scripts: unification of wsrep_sst_backup with the other scripts
parent
fbd88291
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
28 deletions
+14
-28
scripts/wsrep_sst_backup.sh
scripts/wsrep_sst_backup.sh
+14
-28
No files found.
scripts/wsrep_sst_backup.sh
View file @
4cb73f49
...
...
@@ -21,50 +21,32 @@ set -ue
# This is a reference script for rsync-based state snapshot transfer
RSYNC_REAL_PID
=
0
# rsync process id
STUNNEL_REAL_PID
=
0
# stunnel process id
OS
=
"
$(
uname
)
"
[
"
$OS
"
=
'Darwin'
]
&&
export
-n
LD_LIBRARY_PATH
# Setting the path for lsof on CentOS
export
PATH
=
"/usr/sbin:/sbin:
$PATH
"
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
wsrep_check_datadir
MAGIC_FILE
=
"
$WSREP_SST_OPT_DATA
/backup_sst_complete"
rm
-r
"
$MAGIC_FILE
"
DATA
=
"
$WSREP_SST_OPT_DATA
"
WSREP_LOG_DIR
=
${
WSREP_LOG_DIR
:-
""
}
# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
if
[
-z
"
$WSREP_LOG_DIR
"
]
;
then
WSREP_LOG_DIR
=
$(
parse_cnf mysqld innodb-log-group-home-dir
''
)
fi
MAGIC_FILE
=
"
$DATA
/backup_sst_complete"
if
[
-n
"
$WSREP_LOG_DIR
"
]
;
then
# handle both relative and absolute paths
WSREP_LOG_DIR
=
$(
cd
$WSREP_SST_OPT_DATA
;
mkdir
-p
"
$WSREP_LOG_DIR
"
;
cd
$WSREP_LOG_DIR
;
pwd
-P
)
else
# default to datadir
WSREP_LOG_DIR
=
$(
cd
$WSREP_SST_OPT_DATA
;
pwd
-P
)
fi
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
if
[
"
$WSREP_SST_OPT_ROLE
"
=
'donor'
]
then
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
RC
=
0
if
[
$WSREP_SST_OPT_BYPASS
-eq
0
]
;
then
FLUSHED
=
"
$
WSREP_SST_OPT_
DATA
/tables_flushed"
ERROR
=
"
$
WSREP_SST_OPT_
DATA
/sst_error"
FLUSHED
=
"
$DATA
/tables_flushed"
ERROR
=
"
$DATA
/sst_error"
[
-f
"
$FLUSHED
"
]
&&
rm
-f
"
$FLUSHED
"
[
-f
"
$ERROR
"
]
&&
rm
-f
"
$ERROR
"
echo
"flush tables"
echo
'flush tables'
# Wait for :
# (a) Tables to be flushed, AND
...
...
@@ -77,19 +59,23 @@ then
# Check whether ERROR file exists.
if
[
-f
"
$ERROR
"
]
;
then
# Flush tables operation failed.
rm
-f
"
$ERROR
"
rm
"
$ERROR
"
exit
255
fi
sleep
0.2
done
STATE
=
$(
cat
"
$FLUSHED
"
)
rm
-f
"
$FLUSHED
"
rm
"
$FLUSHED
"
else
# BYPASS
wsrep_log_info
"Bypassing state dump."
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
STATE
=
"
$WSREP_SST_OPT_GTID
$WSREP_SST_OPT_GTID_DOMAIN_ID
"
fi
echo
'continue'
# now server can resume updating data
...
...
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