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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ed4819bb
Commit
ed4819bb
authored
May 04, 2010
by
Alfranio Correia
Browse files
Options
Browse Files
Download
Plain Diff
merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam
parents
fb47b303
3c309216
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
sql/slave.cc
sql/slave.cc
+31
-0
sql/sql_repl.cc
sql/sql_repl.cc
+24
-0
No files found.
sql/slave.cc
View file @
ed4819bb
...
@@ -2883,6 +2883,11 @@ pthread_handler_t handle_slave_sql(void *arg)
...
@@ -2883,6 +2883,11 @@ pthread_handler_t handle_slave_sql(void *arg)
{
{
THD
*
thd
;
/* needs to be first for thread_stack */
THD
*
thd
;
/* needs to be first for thread_stack */
char
llbuff
[
22
],
llbuff1
[
22
];
char
llbuff
[
22
],
llbuff1
[
22
];
char
saved_log_name
[
FN_REFLEN
];
char
saved_master_log_name
[
FN_REFLEN
];
my_off_t
saved_log_pos
;
my_off_t
saved_master_log_pos
;
my_off_t
saved_skip
=
0
;
Relay_log_info
*
rli
=
&
((
Master_info
*
)
arg
)
->
rli
;
Relay_log_info
*
rli
=
&
((
Master_info
*
)
arg
)
->
rli
;
const
char
*
errmsg
;
const
char
*
errmsg
;
...
@@ -3028,6 +3033,17 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
...
@@ -3028,6 +3033,17 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
do not want to wait for next event in this case.
do not want to wait for next event in this case.
*/
*/
pthread_mutex_lock
(
&
rli
->
data_lock
);
pthread_mutex_lock
(
&
rli
->
data_lock
);
if
(
rli
->
slave_skip_counter
)
{
char
*
pos
;
pos
=
strmake
(
saved_log_name
,
rli
->
group_relay_log_name
,
FN_REFLEN
-
1
);
pos
=
'\0'
;
pos
=
strmake
(
saved_master_log_name
,
rli
->
group_master_log_name
,
FN_REFLEN
-
1
);
pos
=
'\0'
;
saved_log_pos
=
rli
->
group_relay_log_pos
;
saved_master_log_pos
=
rli
->
group_master_log_pos
;
saved_skip
=
rli
->
slave_skip_counter
;
}
if
(
rli
->
until_condition
!=
Relay_log_info
::
UNTIL_NONE
&&
if
(
rli
->
until_condition
!=
Relay_log_info
::
UNTIL_NONE
&&
rli
->
is_until_satisfied
(
thd
,
NULL
))
rli
->
is_until_satisfied
(
thd
,
NULL
))
{
{
...
@@ -3046,6 +3062,21 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
...
@@ -3046,6 +3062,21 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
thd_proc_info
(
thd
,
"Reading event from the relay log"
);
thd_proc_info
(
thd
,
"Reading event from the relay log"
);
DBUG_ASSERT
(
rli
->
sql_thd
==
thd
);
DBUG_ASSERT
(
rli
->
sql_thd
==
thd
);
THD_CHECK_SENTRY
(
thd
);
THD_CHECK_SENTRY
(
thd
);
if
(
saved_skip
&&
rli
->
slave_skip_counter
==
0
)
{
sql_print_information
(
"'SQL_SLAVE_SKIP_COUNTER=%ld' executed at "
"relay_log_file='%s', relay_log_pos='%ld', master_log_name='%s', "
"master_log_pos='%ld' and new position at "
"relay_log_file='%s', relay_log_pos='%ld', master_log_name='%s', "
"master_log_pos='%ld' "
,
(
ulong
)
saved_skip
,
saved_log_name
,
(
ulong
)
saved_log_pos
,
saved_master_log_name
,
(
ulong
)
saved_master_log_pos
,
rli
->
group_relay_log_name
,
(
ulong
)
rli
->
group_relay_log_pos
,
rli
->
group_master_log_name
,
(
ulong
)
rli
->
group_master_log_pos
);
saved_skip
=
0
;
}
if
(
exec_relay_log_event
(
thd
,
rli
))
if
(
exec_relay_log_event
(
thd
,
rli
))
{
{
DBUG_PRINT
(
"info"
,
(
"exec_relay_log_event() failed"
));
DBUG_PRINT
(
"info"
,
(
"exec_relay_log_event() failed"
));
...
...
sql/sql_repl.cc
View file @
ed4819bb
...
@@ -1134,6 +1134,10 @@ bool change_master(THD* thd, Master_info* mi)
...
@@ -1134,6 +1134,10 @@ bool change_master(THD* thd, Master_info* mi)
int
thread_mask
;
int
thread_mask
;
const
char
*
errmsg
=
0
;
const
char
*
errmsg
=
0
;
bool
need_relay_log_purge
=
1
;
bool
need_relay_log_purge
=
1
;
char
saved_host
[
HOSTNAME_LENGTH
+
1
];
uint
saved_port
;
char
saved_log_name
[
FN_REFLEN
];
my_off_t
saved_log_pos
;
DBUG_ENTER
(
"change_master"
);
DBUG_ENTER
(
"change_master"
);
lock_slave_threads
(
mi
);
lock_slave_threads
(
mi
);
...
@@ -1162,6 +1166,17 @@ bool change_master(THD* thd, Master_info* mi)
...
@@ -1162,6 +1166,17 @@ bool change_master(THD* thd, Master_info* mi)
could possibly modify the data structures from running
could possibly modify the data structures from running
*/
*/
/*
Before processing the command, save the previous state.
*/
char
*
pos
;
pos
=
strmake
(
saved_host
,
mi
->
host
,
HOSTNAME_LENGTH
);
pos
=
'\0'
;
saved_port
=
mi
->
port
;
pos
=
strmake
(
saved_log_name
,
mi
->
master_log_name
,
FN_REFLEN
-
1
);
pos
=
'\0'
;
saved_log_pos
=
mi
->
master_log_pos
;
/*
/*
If the user specified host or port without binlog or position,
If the user specified host or port without binlog or position,
reset binlog's name to FIRST and position to 4.
reset binlog's name to FIRST and position to 4.
...
@@ -1325,6 +1340,15 @@ bool change_master(THD* thd, Master_info* mi)
...
@@ -1325,6 +1340,15 @@ bool change_master(THD* thd, Master_info* mi)
/* Clear the errors, for a clean start */
/* Clear the errors, for a clean start */
mi
->
rli
.
clear_error
();
mi
->
rli
.
clear_error
();
mi
->
rli
.
clear_until_condition
();
mi
->
rli
.
clear_until_condition
();
sql_print_information
(
"'CHANGE MASTER TO executed'. "
"Previous state master_host='%s', master_port='%u', master_log_file='%s', "
"master_log_pos='%ld'. "
"New state master_host='%s', master_port='%u', master_log_file='%s', "
"master_log_pos='%ld'."
,
saved_host
,
saved_port
,
saved_log_name
,
(
ulong
)
saved_log_pos
,
mi
->
host
,
mi
->
port
,
mi
->
master_log_name
,
(
ulong
)
mi
->
master_log_pos
);
/*
/*
If we don't write new coordinates to disk now, then old will remain in
If we don't write new coordinates to disk now, then old will remain in
relay-log.info until START SLAVE is issued; but if mysqld is shutdown
relay-log.info until START SLAVE is issued; but if mysqld is shutdown
...
...
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