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
c0b41c89
Commit
c0b41c89
authored
Feb 04, 2010
by
He Zhenxing
Browse files
Options
Browse Files
Download
Plain Diff
Auto merge
parents
409ef391
d0ffa8e5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
10 deletions
+25
-10
mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
+1
-1
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+1
-1
sql/rpl_mi.cc
sql/rpl_mi.cc
+16
-3
sql/rpl_mi.h
sql/rpl_mi.h
+3
-1
sql/rpl_rli.cc
sql/rpl_rli.cc
+1
-1
sql/slave.cc
sql/slave.cc
+2
-2
sql/sql_repl.cc
sql/sql_repl.cc
+1
-1
No files found.
mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
View file @
c0b41c89
...
...
@@ -382,7 +382,7 @@ let $slave_param_comparison= =;
let
$rcvd_heartbeats_before
=
query_get_value
(
SHOW
STATUS
LIKE
'slave_received_heartbeats'
,
Value
,
1
);
# Flush logs every 0.1 second during 5 sec
--
disable_query_log
let
$i
=
5
0
;
let
$i
=
10
0
;
while
(
$i
)
{
FLUSH
LOGS
;
dec
$i
;
...
...
sql/repl_failsafe.cc
View file @
c0b41c89
...
...
@@ -977,7 +977,7 @@ bool load_master_data(THD* thd)
host was specified; there could have been a problem when replication
started, which led to relay log's IO_CACHE to not be inited.
*/
if
(
flush_master_info
(
active_mi
,
0
))
if
(
flush_master_info
(
active_mi
,
FALSE
,
FALSE
))
sql_print_error
(
"Failed to flush master info file"
);
}
mysql_free_result
(
master_status_res
);
...
...
sql/rpl_mi.cc
View file @
c0b41c89
...
...
@@ -387,7 +387,7 @@ file '%s')", fname);
mi
->
rli
.
is_relay_log_recovery
=
FALSE
;
// now change cache READ -> WRITE - must do this before flush_master_info
reinit_io_cache
(
&
mi
->
file
,
WRITE_CACHE
,
0L
,
0
,
1
);
if
((
error
=
test
(
flush_master_info
(
mi
,
1
))))
if
((
error
=
test
(
flush_master_info
(
mi
,
TRUE
,
TRUE
))))
sql_print_error
(
"Failed to flush master info file"
);
pthread_mutex_unlock
(
&
mi
->
data_lock
);
DBUG_RETURN
(
error
);
...
...
@@ -413,7 +413,9 @@ file '%s')", fname);
1 - flush master info failed
0 - all ok
*/
int
flush_master_info
(
Master_info
*
mi
,
bool
flush_relay_log_cache
)
int
flush_master_info
(
Master_info
*
mi
,
bool
flush_relay_log_cache
,
bool
need_lock_relay_log
)
{
IO_CACHE
*
file
=
&
mi
->
file
;
char
lbuf
[
22
];
...
...
@@ -436,8 +438,19 @@ int flush_master_info(Master_info* mi, bool flush_relay_log_cache)
*/
if
(
flush_relay_log_cache
)
{
pthread_mutex_t
*
log_lock
=
mi
->
rli
.
relay_log
.
get_log_lock
();
IO_CACHE
*
log_file
=
mi
->
rli
.
relay_log
.
get_log_file
();
if
(
flush_io_cache
(
log_file
))
if
(
need_lock_relay_log
)
pthread_mutex_lock
(
log_lock
);
safe_mutex_assert_owner
(
log_lock
);
err
=
flush_io_cache
(
log_file
);
if
(
need_lock_relay_log
)
pthread_mutex_unlock
(
log_lock
);
if
(
err
)
DBUG_RETURN
(
2
);
}
...
...
sql/rpl_mi.h
View file @
c0b41c89
...
...
@@ -120,7 +120,9 @@ int init_master_info(Master_info* mi, const char* master_info_fname,
bool
abort_if_no_master_info_file
,
int
thread_mask
);
void
end_master_info
(
Master_info
*
mi
);
int
flush_master_info
(
Master_info
*
mi
,
bool
flush_relay_log_cache
);
int
flush_master_info
(
Master_info
*
mi
,
bool
flush_relay_log_cache
,
bool
need_lock_relay_log
);
int
change_master_server_id_cmp
(
ulong
*
id1
,
ulong
*
id2
);
#endif
/* HAVE_REPLICATION */
...
...
sql/rpl_rli.cc
View file @
c0b41c89
...
...
@@ -121,7 +121,7 @@ int init_relay_log_info(Relay_log_info* rli,
/*
The relay log will now be opened, as a SEQ_READ_APPEND IO_CACHE.
Note that the I/O thread flushes it to disk after writing every
event, in flush_master_info(mi, 1).
event, in flush_master_info(mi, 1
, ?
).
*/
/*
...
...
sql/slave.cc
View file @
c0b41c89
...
...
@@ -1726,7 +1726,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi)
" to the relay log, SHOW SLAVE STATUS may be"
" inaccurate"
);
rli
->
relay_log
.
harvest_bytes_written
(
&
rli
->
log_space_total
);
if
(
flush_master_info
(
mi
,
1
))
if
(
flush_master_info
(
mi
,
TRUE
,
FALSE
))
sql_print_error
(
"Failed to flush master info file"
);
delete
ev
;
}
...
...
@@ -3047,7 +3047,7 @@ Stopping slave I/O thread due to out-of-memory error from master");
goto
err
;
}
if
(
flush_master_info
(
mi
,
1
))
if
(
flush_master_info
(
mi
,
TRUE
,
TRUE
))
{
sql_print_error
(
"Failed to flush master info file"
);
goto
err
;
...
...
sql/sql_repl.cc
View file @
c0b41c89
...
...
@@ -1532,7 +1532,7 @@ bool change_master(THD* thd, Master_info* mi)
Relay log's IO_CACHE may not be inited, if rli->inited==0 (server was never
a slave before).
*/
if
(
flush_master_info
(
mi
,
0
))
if
(
flush_master_info
(
mi
,
FALSE
,
FALSE
))
{
my_error
(
ER_RELAY_LOG_INIT
,
MYF
(
0
),
"Failed to flush master info file"
);
ret
=
TRUE
;
...
...
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