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
44ccb8f2
Commit
44ccb8f2
authored
Nov 08, 2016
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-10432: Post-fix after merging PR#205
parent
cf1b0c1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
scripts/wsrep_sst_rsync.sh
scripts/wsrep_sst_rsync.sh
+28
-21
No files found.
scripts/wsrep_sst_rsync.sh
View file @
44ccb8f2
...
...
@@ -65,10 +65,10 @@ check_pid_and_port()
case
$OS
in
FreeBSD
)
local
port_info
=
$(
net
stat
-46lp
${
rsync_port
}
2>/dev/null |
\
grep
":
${
rsync_port
}
"
)
local
is_rsync
=
$(
echo
$port_info
|
\
grep
-w
'[[:space:]]\+rsync[[:space:]]\+'
"
$rsync_pid
"
2>/dev/null
)
local
port_info
=
"
$(
sock
stat
-46lp
${
rsync_port
}
2>/dev/null |
\
grep
":
${
rsync_port
}
"
)
"
local
is_rsync
=
"
$(
echo
$port_info
|
\
grep
-w
'[[:space:]]\+rsync[[:space:]]\+'
"
$rsync_pid
"
2>/dev/null
)
"
;;
*
)
if
!
which lsof
>
/dev/null
;
then
...
...
@@ -76,17 +76,18 @@ check_pid_and_port()
exit
2
# ENOENT
fi
local
port_info
=
$(
lsof
-i
:
$rsync_port
-Pn
2>/dev/null |
\
grep
"(LISTEN)"
)
local
is_listening_all
=
$(
echo
$port_info
|
\
grep
"*:
$rsync_port
"
2>/dev/null
)
local
is_listening_addr
=
$(
echo
$port_info
|
\
grep
"
$rsync_addr
:
$rsync_port
"
2>/dev/null
)
local
is_rsync
=
$(
echo
$port_info
|
\
grep
-w
'^rsync[[:space:]]\+'
"
$rsync_pid
"
2>/dev/null
)
local
port_info
=
"
$(
lsof
-i
:
$rsync_port
-Pn
2>/dev/null |
\
grep
"(LISTEN)"
)
"
local
is_rsync
=
"
$(
echo
$port_info
|
\
grep
-w
'^rsync[[:space:]]\+'
"
$rsync_pid
"
2>/dev/null
)
"
;;
esac
local
is_listening_all
=
"
$(
echo
$port_info
|
\
grep
"*:
$rsync_port
"
2>/dev/null
)
"
local
is_listening_addr
=
"
$(
echo
$port_info
|
\
grep
"
$rsync_addr
:
$rsync_port
"
2>/dev/null
)
"
if
[
!
-z
"
$is_listening_all
"
-o
!
-z
"
$is_listening_addr
"
]
;
then
if
[
-z
"
$is_rsync
"
]
;
then
wsrep_log_error
"rsync daemon port '
$rsync_port
' has been taken"
...
...
@@ -202,7 +203,9 @@ then
if
!
[
-z
$WSREP_SST_OPT_BINLOG
]
then
# Prepare binlog files
pushd
$BINLOG_DIRNAME
&> /dev/null
OLD_PWD
=
"
$(
pwd
)
"
cd
$BINLOG_DIRNAME
binlog_files_full
=
$(
tail
-n
$BINLOG_N_FILES
${
BINLOG_FILENAME
}
.index
)
binlog_files
=
""
for
ii
in
$binlog_files_full
...
...
@@ -214,14 +217,14 @@ then
wsrep_log_info
"Preparing binlog files for transfer:"
tar
-cvf
$BINLOG_TAR_FILE
$binlog_files
>
&2
fi
popd
&> /dev/null
cd
"
$OLD_PWD
"
fi
# first, the normal directories, so that we can detect incompatible protocol
RC
=
0
rsync
--owner
--group
--perms
--links
--specials
\
eval
rsync
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
"
${
FILTER
}
"
"
$WSREP_SST_OPT_DATA
/"
\
$WHOLE_FILE_OPT
${
FILTER
}
"
$WSREP_SST_OPT_DATA
/"
\
rsync://
$WSREP_SST_OPT_ADDR
>
&2
||
RC
=
$?
if
[
"
$RC
"
-ne
0
]
;
then
...
...
@@ -253,7 +256,8 @@ then
fi
# then, we parallelize the transfer of database directories, use . so that pathconcatenation works
pushd
"
$WSREP_SST_OPT_DATA
"
>
/dev/null
OLD_PWD
=
"
$(
pwd
)
"
cd
$WSREP_SST_OPT_DATA
count
=
1
[
"
$OS
"
=
"Linux"
]
&&
count
=
$(
grep
-c
processor /proc/cpuinfo
)
...
...
@@ -266,7 +270,7 @@ then
$WHOLE_FILE_OPT
--exclude
'*/ib_logfile*'
"
$WSREP_SST_OPT_DATA
"
/
{}
/
\
rsync://
$WSREP_SST_OPT_ADDR
/
{}
>
&2
||
RC
=
$?
popd
>
/dev/null
cd
"
$OLD_PWD
"
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"find/rsync returned code
$RC
:"
...
...
@@ -377,7 +381,9 @@ EOF
if
!
[
-z
$WSREP_SST_OPT_BINLOG
]
then
pushd
$BINLOG_DIRNAME
&> /dev/null
OLD_PWD
=
"
$(
pwd
)
"
cd
$BINLOG_DIRNAME
if
[
-f
$BINLOG_TAR_FILE
]
then
# Clean up old binlog files first
...
...
@@ -389,7 +395,8 @@ EOF
echo
${
BINLOG_DIRNAME
}
/
${
ii
}
>>
${
BINLOG_FILENAME
}
.index
done
fi
popd
&> /dev/null
cd
"
$OLD_PWD
"
fi
if
[
-r
"
$MAGIC_FILE
"
]
then
...
...
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