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
7134afa2
Commit
7134afa2
authored
Jul 27, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MYSQL_BIN_LOG::open/close must be under LOCK_log
parent
c7842775
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
sql/rpl_rli.cc
sql/rpl_rli.cc
+11
-2
No files found.
sql/rpl_rli.cc
View file @
7134afa2
...
@@ -256,8 +256,8 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
...
@@ -256,8 +256,8 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
if
((
info_fd
=
mysql_file_open
(
key_file_relay_log_info
,
if
((
info_fd
=
mysql_file_open
(
key_file_relay_log_info
,
fname
,
O_CREAT
|
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
)))
<
0
)
fname
,
O_CREAT
|
O_RDWR
|
O_BINARY
,
MYF
(
MY_WME
)))
<
0
)
{
{
sql_print_error
(
"Failed to create a new relay log info file (
\
sql_print_error
(
"Failed to create a new relay log info file (
"
file '%s', errno %d)"
,
fname
,
my_errno
);
"
file '%s', errno %d)"
,
fname
,
my_errno
);
msg
=
current_thd
->
get_stmt_da
()
->
message
();
msg
=
current_thd
->
get_stmt_da
()
->
message
();
goto
err
;
goto
err
;
}
}
...
@@ -450,7 +450,9 @@ Failed to open the existing relay log info file '%s' (errno %d)",
...
@@ -450,7 +450,9 @@ Failed to open the existing relay log info file '%s' (errno %d)",
if
(
info_fd
>=
0
)
if
(
info_fd
>=
0
)
mysql_file_close
(
info_fd
,
MYF
(
0
));
mysql_file_close
(
info_fd
,
MYF
(
0
));
rli
->
info_fd
=
-
1
;
rli
->
info_fd
=
-
1
;
mysql_mutex_lock
(
rli
->
relay_log
.
get_log_lock
());
rli
->
relay_log
.
close
(
LOG_CLOSE_INDEX
|
LOG_CLOSE_STOP_EVENT
);
rli
->
relay_log
.
close
(
LOG_CLOSE_INDEX
|
LOG_CLOSE_STOP_EVENT
);
mysql_mutex_unlock
(
rli
->
relay_log
.
get_log_lock
());
mysql_mutex_unlock
(
&
rli
->
data_lock
);
mysql_mutex_unlock
(
&
rli
->
data_lock
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
@@ -1145,14 +1147,17 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
...
@@ -1145,14 +1147,17 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
"log index file:%s."
,
rli
->
relay_log
.
get_index_fname
());
"log index file:%s."
,
rli
->
relay_log
.
get_index_fname
());
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
mysql_mutex_lock
(
rli
->
relay_log
.
get_log_lock
());
if
(
rli
->
relay_log
.
open
(
ln
,
LOG_BIN
,
0
,
SEQ_READ_APPEND
,
if
(
rli
->
relay_log
.
open
(
ln
,
LOG_BIN
,
0
,
SEQ_READ_APPEND
,
(
rli
->
max_relay_log_size
?
rli
->
max_relay_log_size
:
(
rli
->
max_relay_log_size
?
rli
->
max_relay_log_size
:
max_binlog_size
),
1
,
TRUE
))
max_binlog_size
),
1
,
TRUE
))
{
{
sql_print_error
(
"Unable to purge relay log files. Failed to open relay "
sql_print_error
(
"Unable to purge relay log files. Failed to open relay "
"log file:%s."
,
rli
->
relay_log
.
get_log_fname
());
"log file:%s."
,
rli
->
relay_log
.
get_log_fname
());
mysql_mutex_unlock
(
rli
->
relay_log
.
get_log_lock
());
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
mysql_mutex_unlock
(
rli
->
relay_log
.
get_log_lock
());
}
}
else
else
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
@@ -1210,7 +1215,11 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
...
@@ -1210,7 +1215,11 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
}
}
if
(
!
rli
->
inited
&&
rli
->
error_on_rli_init_info
)
if
(
!
rli
->
inited
&&
rli
->
error_on_rli_init_info
)
{
mysql_mutex_lock
(
rli
->
relay_log
.
get_log_lock
());
rli
->
relay_log
.
close
(
LOG_CLOSE_INDEX
|
LOG_CLOSE_STOP_EVENT
);
rli
->
relay_log
.
close
(
LOG_CLOSE_INDEX
|
LOG_CLOSE_STOP_EVENT
);
mysql_mutex_unlock
(
rli
->
relay_log
.
get_log_lock
());
}
err:
err:
#ifndef DBUG_OFF
#ifndef DBUG_OFF
char
buf
[
22
];
char
buf
[
22
];
...
...
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