Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiangyu Tong
server
Commits
ba7f73f0
Commit
ba7f73f0
authored
11 years ago
by
Nirbhay Choubey
Browse files
Options
Downloads
Patches
Plain Diff
* Merging fix for lp:1224775
* Removing duplicate code
parent
f4defb0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/mysqld_safe.sh
+9
-39
9 additions, 39 deletions
scripts/mysqld_safe.sh
with
9 additions
and
39 deletions
scripts/mysqld_safe.sh
+
9
−
39
View file @
ba7f73f0
...
...
@@ -224,23 +224,27 @@ wsrep_pick_url() {
wsrep_start_position_opt
=
""
wsrep_recover_position
()
{
local
mysqld_cmd
=
"
$@
"
local
wr_logfile
=
$(
mktemp
)
local
euid
=
$(
id
-u
)
local
ret
=
0
local
wr_logfile
=
$(
mktemp
$DATADIR
/wsrep_recovery.XXXXXX
)
[
"
$euid
"
=
"0"
]
&&
chown
$user
$wr_logfile
chmod
600
$wr_logfile
log_notice
"WSREP: Running position recovery with --log_error=
$wr_logfile
"
local
wr_pidfile
=
"
$DATADIR
/"
`
@HOSTNAME@
`
"-recover.pid"
local
wr_options
=
"--log_error='
$wr_logfile
' --pid-file='
$wr_pidfile
'"
log_notice
"WSREP: Running position recovery with
$wr_options
"
eval_log_error
"
$mysqld_cmd
--log_error=
$wr_logfile
--wsrep
-
recover"
eval_log_error
"
$mysqld_cmd
--wsrep
_
recover
$wr_options
"
local
rp
=
"
$(
grep
'WSREP: Recovered position:'
$wr_logfile
)
"
if
[
-z
"
$rp
"
]
;
then
local
skipped
=
"
$(
grep
WSREP
$wr_logfile
|
grep
'skipping position recovery'
)
"
if
[
-z
"
$skipped
"
]
;
then
log_error
"WSREP: Failed to recover position:
'
`
cat
$wr_logfile
`
'"
log_error
"WSREP: Failed to recover position: '
`
cat
$wr_logfile
`
'"
ret
=
1
else
log_notice
"WSREP: Position recovery skipped"
...
...
@@ -845,40 +849,6 @@ mysqld daemon not started"
fi
fi
# Flush and purge buffers/caches.
#
if
@TARGET_LINUX@
&&
test
$flush_caches
-eq
1
then
# Locate sync, ensure it exists.
if
!
my_which
sync
>
/dev/null 2>&1
then
log_error
"sync command not found, required for --flush-caches"
exit
1
# Flush file system buffers.
elif
!
sync
then
# Huh, the sync() function is always successful...
log_error
"sync failed, check if sync is properly installed"
fi
# Locate sysctl, ensure it exists.
if
!
my_which sysctl
>
/dev/null 2>&1
then
log_error
"sysctl command not found, required for --flush-caches"
exit
1
# Purge page cache, dentries and inodes.
elif
!
sysctl
-q
-w
vm.drop_caches
=
3
then
log_error
"sysctl failed, check the error message for details"
exit
1
fi
elif
test
$flush_caches
-eq
1
then
log_error
"--flush-caches is not supported on this platform"
exit
1
fi
#
# Flush and purge buffers/caches.
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment