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
202fd502
Commit
202fd502
authored
Sep 12, 2024
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
galera SST scripts: fixes for error logging in non-linux systems
parent
606c867e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
24 deletions
+35
-24
scripts/wsrep_sst_common.sh
scripts/wsrep_sst_common.sh
+35
-24
No files found.
scripts/wsrep_sst_common.sh
View file @
202fd502
...
@@ -39,11 +39,45 @@ commandex()
...
@@ -39,11 +39,45 @@ commandex()
fi
fi
}
}
with_bash_42
=
0
with_printf
=
1
with_printf
=
1
if
[
-z
"
$BASH_VERSION
"
]
;
then
if
[
-z
"
$BASH_VERSION
"
]
;
then
[
-z
"
$(
commandex
printf
)
"
]
&&
with_printf
=
0
[
-z
"
$(
commandex
printf
)
"
]
&&
with_printf
=
0
else
[
"
${
BASH_VERSINFO
[0]
}
"
-eq
4
-a
"
${
BASH_VERSINFO
[1]
}
"
-ge
2
-o
\
"
${
BASH_VERSINFO
[0]
}
"
-gt
4
]
&&
with_bash_42
=
1
fi
fi
wsrep_log
()
{
local
t
# echo everything to stderr so that it gets into common error log
# deliberately made to look different from the rest of the log
if
[
"
$OS
"
=
'Linux'
]
;
then
t
=
$(
date
'+%Y%m%d %H:%M:%S.%3N'
)
elif
[
$with_bash_42
-ne
0
]
;
then
printf
-v
t
'%(%Y%m%d %H:%M:%S)T.000'
else
t
=
$(
date
'+%Y%m%d %H:%M:%S.000'
)
fi
echo
"WSREP_SST:
$*
(
$t
)"
>
&2
}
wsrep_log_error
()
{
wsrep_log
"[ERROR]
$*
"
}
wsrep_log_warning
()
{
wsrep_log
"[WARNING]
$*
"
}
wsrep_log_info
()
{
wsrep_log
"[INFO]
$*
"
}
trim_string
()
trim_string
()
{
{
if
[
-n
"
$BASH_VERSION
"
]
;
then
if
[
-n
"
$BASH_VERSION
"
]
;
then
...
@@ -844,29 +878,6 @@ else
...
@@ -844,29 +878,6 @@ else
MYSQLDUMP
=
$(
commandex
'mysqldump'
)
MYSQLDUMP
=
$(
commandex
'mysqldump'
)
fi
fi
wsrep_log
()
{
# echo everything to stderr so that it gets into common error log
# deliberately made to look different from the rest of the log
local readonly
tst
=
$(
date
"+%Y%m%d %H:%M:%S.%N"
|
cut
-b
-21
)
echo
"WSREP_SST:
$*
(
$tst
)"
>
&2
}
wsrep_log_error
()
{
wsrep_log
"[ERROR]
$*
"
}
wsrep_log_warning
()
{
wsrep_log
"[WARNING]
$*
"
}
wsrep_log_info
()
{
wsrep_log
"[INFO]
$*
"
}
if
[
-x
"
$SCRIPTS_DIR
/my_print_defaults"
]
;
then
if
[
-x
"
$SCRIPTS_DIR
/my_print_defaults"
]
;
then
MY_PRINT_DEFAULTS
=
"
$SCRIPTS_DIR
/my_print_defaults"
MY_PRINT_DEFAULTS
=
"
$SCRIPTS_DIR
/my_print_defaults"
elif
[
-x
"
$EXTRA_DIR
/my_print_defaults"
]
;
then
elif
[
-x
"
$EXTRA_DIR
/my_print_defaults"
]
;
then
...
@@ -1090,7 +1101,7 @@ wsrep_check_program()
...
@@ -1090,7 +1101,7 @@ wsrep_check_program()
local
prog
=
"
$1
"
local
prog
=
"
$1
"
local
cmd
=
$(
commandex
"
$prog
"
)
local
cmd
=
$(
commandex
"
$prog
"
)
if
[
-z
"
$cmd
"
]
;
then
if
[
-z
"
$cmd
"
]
;
then
echo
"'
$prog
' not found in PATH
"
wsrep_log_error
"'
$prog
' not found in path
"
return
2
# no such file or directory
return
2
# no such file or directory
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