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
ae67b97c
Commit
ae67b97c
authored
Dec 04, 2003
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
parents
132537ac
1b4bd22b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
sql/slave.cc
sql/slave.cc
+26
-5
No files found.
sql/slave.cc
View file @
ae67b97c
...
@@ -3497,8 +3497,20 @@ rli->relay_log_pos=%s rli->pending=%lu",
...
@@ -3497,8 +3497,20 @@ rli->relay_log_pos=%s rli->pending=%lu",
sizeof
(
rli
->
relay_log_name
)
-
1
);
sizeof
(
rli
->
relay_log_name
)
-
1
);
flush_relay_log_info
(
rli
);
flush_relay_log_info
(
rli
);
}
}
// next log is hot
/*
Now we want to open this next log. To know if it's a hot log (the one
being written by the I/O thread now) or a cold log, we can use
is_active(); if it is hot, we use the I/O cache; if it's cold we open
the file normally. But if is_active() reports that the log is hot, this
may change between the test and the consequence of the test. So we may
open the I/O cache whereas the log is now cold, which is nonsense.
To guard against this, we need to have LOCK_log.
*/
DBUG_PRINT
(
"info"
,(
"hot_log: %d"
,
hot_log
));
if
(
!
hot_log
)
/* if hot_log, we already have this mutex */
pthread_mutex_lock
(
log_lock
);
if
(
rli
->
relay_log
.
is_active
(
rli
->
linfo
.
log_file_name
))
if
(
rli
->
relay_log
.
is_active
(
rli
->
linfo
.
log_file_name
))
{
{
#ifdef EXTRA_DEBUG
#ifdef EXTRA_DEBUG
...
@@ -3511,15 +3523,24 @@ rli->relay_log_pos=%s rli->pending=%lu",
...
@@ -3511,15 +3523,24 @@ rli->relay_log_pos=%s rli->pending=%lu",
/*
/*
Read pointer has to be at the start since we are the only
Read pointer has to be at the start since we are the only
reader
reader.
We must keep the LOCK_log to read the 4 first bytes, as this is a hot
log (same as when we call read_log_event() above: for a hot log we
take the mutex).
*/
*/
if
(
check_binlog_magic
(
cur_log
,
&
errmsg
))
if
(
check_binlog_magic
(
cur_log
,
&
errmsg
))
{
if
(
!
hot_log
)
pthread_mutex_unlock
(
log_lock
);
goto
err
;
goto
err
;
}
if
(
!
hot_log
)
pthread_mutex_unlock
(
log_lock
);
continue
;
continue
;
}
}
if
(
!
hot_log
)
pthread_mutex_unlock
(
log_lock
);
/*
/*
if we get here, the log was not hot, so we will have to
if we get here, the log was not hot, so we will have to open it
open it ourselves
ourselves. We are sure that the log is still not hot now (a log can get
from hot to cold, but not from cold to hot). No need for LOCK_log.
*/
*/
#ifdef EXTRA_DEBUG
#ifdef EXTRA_DEBUG
sql_print_error
(
"next log '%s' is not active"
,
sql_print_error
(
"next log '%s' is not active"
,
...
...
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