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
2084cd54
Commit
2084cd54
authored
Jan 21, 2019
by
Geoff Montee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17973: Don't overwrite xtrabackup-v2/mariabackup SST logs by default
parent
1d72db45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
8 deletions
+70
-8
scripts/wsrep_sst_mariabackup.sh
scripts/wsrep_sst_mariabackup.sh
+70
-8
No files found.
scripts/wsrep_sst_mariabackup.sh
View file @
2084cd54
...
@@ -90,6 +90,9 @@ DATA="${WSREP_SST_OPT_DATA}"
...
@@ -90,6 +90,9 @@ DATA="${WSREP_SST_OPT_DATA}"
INFO_FILE
=
"xtrabackup_galera_info"
INFO_FILE
=
"xtrabackup_galera_info"
IST_FILE
=
"xtrabackup_ist"
IST_FILE
=
"xtrabackup_ist"
MAGIC_FILE
=
"
${
DATA
}
/
${
INFO_FILE
}
"
MAGIC_FILE
=
"
${
DATA
}
/
${
INFO_FILE
}
"
INNOAPPLYLOG
=
"
${
DATA
}
/mariabackup.prepare.log"
INNOMOVELOG
=
"
${
DATA
}
/mariabackup.move.log"
INNOBACKUPLOG
=
"
${
DATA
}
/mariabackup.backup.log"
# Setting the path for ss and ip
# Setting the path for ss and ip
export
PATH
=
"/usr/sbin:/sbin:
$PATH
"
export
PATH
=
"/usr/sbin:/sbin:
$PATH
"
...
@@ -356,6 +359,8 @@ read_cnf()
...
@@ -356,6 +359,8 @@ read_cnf()
ssyslog
=
$(
parse_cnf sst sst-syslog 0
)
ssyslog
=
$(
parse_cnf sst sst-syslog 0
)
ssystag
=
$(
parse_cnf mysqld_safe syslog-tag
"
${
SST_SYSLOG_TAG
:-}
"
)
ssystag
=
$(
parse_cnf mysqld_safe syslog-tag
"
${
SST_SYSLOG_TAG
:-}
"
)
ssystag+
=
"-"
ssystag+
=
"-"
sstlogarchive
=
$(
parse_cnf sst sst-log-archive 1
)
sstlogarchivedir
=
$(
parse_cnf sst sst-log-archive-dir
"/tmp/sst_log_archive"
)
if
[[
$speciald
-eq
0
]]
;
then
if
[[
$speciald
-eq
0
]]
;
then
wsrep_log_error
"sst-special-dirs equal to 0 is not supported, falling back to 1"
wsrep_log_error
"sst-special-dirs equal to 0 is not supported, falling back to 1"
...
@@ -713,9 +718,67 @@ if [[ $ssyslog -eq 1 ]];then
...
@@ -713,9 +718,67 @@ if [[ $ssyslog -eq 1 ]];then
fi
fi
else
else
INNOAPPLY
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
$disver
$iapts
--apply-log
\$
rebuildcmd
\$
{DATA} &>
\$
{DATA}/innobackup.prepare.log"
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
${
WSREP_SST_OPT_CONF
}
$disver
$impts
--move-back --force-non-empty-directories
\$
{DATA} &>
\$
{DATA}/innobackup.move.log"
if
[[
"
$sstlogarchive
"
-eq
1
]]
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
${
WSREP_SST_OPT_CONF
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2>
\$
{DATA}/innobackup.backup.log"
then
ARCHIVETIMESTAMP
=
$(
date
"+%Y.%m.%d-%H.%M.%S"
)
newfile
=
""
if
[[
!
-z
"
$sstlogarchivedir
"
]]
then
if
[[
!
-d
"
$sstlogarchivedir
"
]]
then
mkdir
-p
"
$sstlogarchivedir
"
fi
fi
if
[
-e
"
${
INNOAPPLYLOG
}
"
]
then
if
[[
!
-z
"
$sstlogarchivedir
"
]]
then
newfile
=
$sstlogarchivedir
/
$(
basename
"
${
INNOAPPLYLOG
}
"
)
.
${
ARCHIVETIMESTAMP
}
else
newfile
=
${
INNOAPPLYLOG
}
.
${
ARCHIVETIMESTAMP
}
fi
wsrep_log_info
"Moving
${
INNOAPPLYLOG
}
to
${
newfile
}
"
mv
"
${
INNOAPPLYLOG
}
"
"
${
newfile
}
"
gzip
"
${
newfile
}
"
fi
if
[
-e
"
${
INNOMOVELOG
}
"
]
then
if
[[
!
-z
"
$sstlogarchivedir
"
]]
then
newfile
=
$sstlogarchivedir
/
$(
basename
"
${
INNOMOVELOG
}
"
)
.
${
ARCHIVETIMESTAMP
}
else
newfile
=
${
INNOMOVELOG
}
.
${
ARCHIVETIMESTAMP
}
fi
wsrep_log_info
"Moving
${
INNOMOVELOG
}
to
${
newfile
}
"
mv
"
${
INNOMOVELOG
}
"
"
${
newfile
}
"
gzip
"
${
newfile
}
"
fi
if
[
-e
"
${
INNOBACKUPLOG
}
"
]
then
if
[[
!
-z
"
$sstlogarchivedir
"
]]
then
newfile
=
$sstlogarchivedir
/
$(
basename
"
${
INNOBACKUPLOG
}
"
)
.
${
ARCHIVETIMESTAMP
}
else
newfile
=
${
INNOBACKUPLOG
}
.
${
ARCHIVETIMESTAMP
}
fi
wsrep_log_info
"Moving
${
INNOBACKUPLOG
}
to
${
newfile
}
"
mv
"
${
INNOBACKUPLOG
}
"
"
${
newfile
}
"
gzip
"
${
newfile
}
"
fi
fi
INNOAPPLY
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
$disver
$iapts
--apply-log
\$
rebuildcmd
\$
{DATA} &>
${
INNOAPPLYLOG
}
"
INNOMOVE
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
${
WSREP_SST_OPT_CONF
}
$disver
$impts
--move-back --force-non-empty-directories
\$
{DATA} &>
${
INNOMOVELOG
}
"
INNOBACKUP
=
"
${
INNOBACKUPEX_BIN
}
--innobackupex
${
WSREP_SST_OPT_CONF
}
$disver
$iopts
\$
tmpopts
\$
INNOEXTRA --galera-info --stream=
\$
sfmt
\$
itmpdir 2>
${
INNOBACKUPLOG
}
"
fi
fi
get_stream
get_stream
...
@@ -812,7 +875,7 @@ then
...
@@ -812,7 +875,7 @@ then
if
[
${
RC
[0]
}
-ne
0
]
;
then
if
[
${
RC
[0]
}
-ne
0
]
;
then
wsrep_log_error
"
${
INNOBACKUPEX_BIN
}
finished with error:
${
RC
[0]
}
. "
\
wsrep_log_error
"
${
INNOBACKUPEX_BIN
}
finished with error:
${
RC
[0]
}
. "
\
"Check
${
DATA
}
/innobackup.backup.log
"
"Check
syslog or
${
INNOBACKUPLOG
}
for details
"
exit
22
exit
22
elif
[[
${
RC
[
$((
${#
RC
[@]
}
-
1
))
]
}
-eq
1
]]
;
then
elif
[[
${
RC
[
$((
${#
RC
[@]
}
-
1
))
]
}
-eq
1
]]
;
then
wsrep_log_error
"
$tcmd
finished with error:
${
RC
[1]
}
"
wsrep_log_error
"
$tcmd
finished with error:
${
RC
[1]
}
"
...
@@ -1033,13 +1096,12 @@ then
...
@@ -1033,13 +1096,12 @@ then
if
[
$?
-ne
0
]
;
if
[
$?
-ne
0
]
;
then
then
wsrep_log_error
"
${
INNOBACKUPEX_BIN
}
apply finished with errors. Check
${
DATA
}
/innobackup.prepare.log
"
wsrep_log_error
"
${
INNOBACKUPEX_BIN
}
apply finished with errors. Check
syslog or
${
INNOAPPLYLOG
}
for details
"
exit
22
exit
22
fi
fi
MAGIC_FILE
=
"
${
TDATA
}
/
${
INFO_FILE
}
"
MAGIC_FILE
=
"
${
TDATA
}
/
${
INFO_FILE
}
"
set
+e
set
+e
rm
$TDATA
/innobackup.prepare.log
$TDATA
/innobackup.move.log
set
-e
set
-e
wsrep_log_info
"Moving the backup to
${
TDATA
}
"
wsrep_log_info
"Moving the backup to
${
TDATA
}
"
timeit
"Xtrabackup move stage"
"
$INNOMOVE
"
timeit
"Xtrabackup move stage"
"
$INNOMOVE
"
...
@@ -1049,7 +1111,7 @@ then
...
@@ -1049,7 +1111,7 @@ then
DATA
=
${
TDATA
}
DATA
=
${
TDATA
}
else
else
wsrep_log_error
"Move failed, keeping
${
DATA
}
for further diagnosis"
wsrep_log_error
"Move failed, keeping
${
DATA
}
for further diagnosis"
wsrep_log_error
"Check
${
DATA
}
/innobackup.move.log
for details"
wsrep_log_error
"Check
syslog or
${
INNOMOVELOG
}
for details"
exit
22
exit
22
fi
fi
...
...
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