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
b1816f78
Commit
b1816f78
authored
Sep 16, 2024
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug-2
parent
2ada156c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
scripts/wsrep_sst_common.sh
scripts/wsrep_sst_common.sh
+39
-3
No files found.
scripts/wsrep_sst_common.sh
View file @
b1816f78
...
...
@@ -1233,7 +1233,7 @@ check_sockets_utils()
# sockstat in FreeBSD is different from other systems,
# let's denote it with a different value:
sockstat_available
=
2
sockstat_opts
=
'-46lq -P tcp -p'
#
sockstat_opts='-46lq -P tcp -p'
fi
else
socket_utility
=
"
$(
commandex lsof
)
"
...
...
@@ -1288,8 +1288,44 @@ check_port()
# The sockstat command on FreeBSD does not return
# the connection state without special option, but
# it supports filtering by connection state:
$socket_utility
$sockstat_opts
"
$port
"
2>/dev/null |
\
$socket_utility
$sockstat_opts
"
$port
"
2>/dev/null |
tee
/dev/stderr |
\
grep
-q
-E
"^[^[:space:]]+[[:space:]]+(
$utils
)[^[:space:]]*[[:space:]]+
$pid
([[:space:]]|
\$
)"
&&
rc
=
0
local
x
=
$(
$socket_utility
$sockstat_opts
"
$port
"
||
:
)
local
y
=
$(
echo
"
$x
"
|
grep
-E
"^[^[:space:]]+[[:space:]]+(
$utils
)[^[:space:]]*[[:space:]]+
$pid
([[:space:]]|
\$
)"
||
:
)
local
z
=
1
local
r
=
0
echo
"
$x
"
|
grep
-q
-E
"^[^[:space:]]+[[:space:]]+(
$utils
)[^[:space:]]*[[:space:]]+
$pid
([[:space:]]|
\$
)"
&&
z
=
0
if
[
$z
-ne
0
-a
-n
"
$y
"
]
;
then
wsrep_log_info
"BUG: z != 0 && y != ''"
r
=
1
fi
if
[
$z
-eq
0
-a
-z
"
$y
"
]
;
then
wsrep_log_info
"BUG: z == 0 && y == ''"
r
=
1
fi
if
[
$z
-eq
0
-a
$rc
-ne
0
]
;
then
wsrep_log_info
"BUG: z != rc (rc != 0)"
r
=
1
fi
if
[
$z
-ne
0
-a
$rc
-eq
0
]
;
then
wsrep_log_info
"BUG: z != rc (rc == 0)"
r
=
1
fi
if
[
-n
"
$y
"
-a
$rc
-ne
0
]
;
then
wsrep_log_info
"BUG: y != '' && rc != 0"
r
=
1
fi
if
[
$r
-ne
0
]
;
then
wsrep_log_info
"**************************"
wsrep_log_info
"x=[
$x
]"
wsrep_log_info
"y=[
$y
]"
wsrep_log_info
"z=[
$z
]"
wsrep_log_info
"rc=[
$rc
]"
wsrep_log_info
"**************************"
$socket_utility
$sockstat_opts
"
$port
"
>
&2
||
:
wsrep_log_info
"**************************"
exit
22
fi
else
$socket_utility
$sockstat_opts
"
$port
"
2>/dev/null |
\
grep
-q
-E
"^[^[:space:]]+[[:space:]]+(
$utils
)[^[:space:]]*[[:space:]]+
$pid
([[:space:]].+)?[[:space:]]LISTEN([[:space:]]|
\$
)"
&&
rc
=
0
...
...
@@ -1569,7 +1605,7 @@ get_proc()
if [ "
$OS
" = 'Linux' ]; then
nproc=
$(
grep
-cw
-E
'^processor'
/proc/cpuinfo 2>/dev/null
||
:
)
elif [ "
$OS
" = 'Darwin' -o "
$OS
" = 'FreeBSD' ]; then
nproc=
$(
sysctl
-n
hw.ncpu
||
:
)
nproc=
$(
sysctl
-n
hw.ncpu
)
fi
set -e
if [ -z "
$nproc
" ] || [
$nproc
-eq 0 ]; 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