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
2931e100
Commit
2931e100
authored
Nov 28, 2003
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/my/mysql-4.1
parents
59140334
398c8de8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
sql-common/client.c
sql-common/client.c
+1
-1
sql/slave.cc
sql/slave.cc
+24
-14
No files found.
sql-common/client.c
View file @
2931e100
...
@@ -1456,8 +1456,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1456,8 +1456,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
user
?
user
:
"(Null)"
));
user
?
user
:
"(Null)"
));
/* Don't give sigpipe errors if the client doesn't want them */
/* Don't give sigpipe errors if the client doesn't want them */
mysql
->
methods
=
&
client_methods
;
set_sigpipe
(
mysql
);
set_sigpipe
(
mysql
);
mysql
->
methods
=
&
client_methods
;
net
->
vio
=
0
;
/* If something goes wrong */
net
->
vio
=
0
;
/* If something goes wrong */
mysql
->
client_flag
=
0
;
/* For handshake */
mysql
->
client_flag
=
0
;
/* For handshake */
...
...
sql/slave.cc
View file @
2931e100
...
@@ -2084,6 +2084,30 @@ bool flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
...
@@ -2084,6 +2084,30 @@ bool flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
DBUG_ENTER
(
"flush_master_info"
);
DBUG_ENTER
(
"flush_master_info"
);
DBUG_PRINT
(
"enter"
,(
"master_pos: %ld"
,
(
long
)
mi
->
master_log_pos
));
DBUG_PRINT
(
"enter"
,(
"master_pos: %ld"
,
(
long
)
mi
->
master_log_pos
));
/*
Flush the relay log to disk. If we don't do it, then the relay log while
have some part (its last kilobytes) in memory only, so if the slave server
dies now, with, say, from master's position 100 to 150 in memory only (not
on disk), and with position 150 in master.info, then when the slave
restarts, the I/O thread will fetch binlogs from 150, so in the relay log
we will have "[0, 100] U [150, infinity[" and nobody will notice it, so the
SQL thread will jump from 100 to 150, and replication will silently break.
When we come to this place in code, relay log may or not be initialized;
the caller is responsible for setting 'flush_relay_log_cache' accordingly.
*/
if
(
flush_relay_log_cache
)
flush_io_cache
(
mi
->
rli
.
relay_log
.
get_log_file
());
/*
We flushed the relay log BEFORE the master.info file, because if we crash
now, we will get a duplicate event in the relay log at restart. If we
flushed in the other order, we would get a hole in the relay log.
And duplicate is better than hole (with a duplicate, in later versions we
can add detection and scrap one event; with a hole there's nothing we can
do).
*/
/*
/*
In certain cases this code may create master.info files that seems
In certain cases this code may create master.info files that seems
corrupted, because of extra lines filled with garbage in the end
corrupted, because of extra lines filled with garbage in the end
...
@@ -2101,20 +2125,6 @@ bool flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
...
@@ -2101,20 +2125,6 @@ bool flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
(
int
)(
mi
->
ssl
),
mi
->
ssl_ca
,
mi
->
ssl_capath
,
mi
->
ssl_cert
,
(
int
)(
mi
->
ssl
),
mi
->
ssl_ca
,
mi
->
ssl_capath
,
mi
->
ssl_cert
,
mi
->
ssl_cipher
,
mi
->
ssl_key
);
mi
->
ssl_cipher
,
mi
->
ssl_key
);
flush_io_cache
(
file
);
flush_io_cache
(
file
);
/*
Flush the relay log to disk. If we don't do it, then the relay log while
have some part (its last kilobytes) in memory only, so if the slave server
dies now, with, say, from master's position 100 to 150 in memory only (not
on disk), and with position 150 in master.info, then when the slave
restarts, the I/O thread will fetch binlogs from 150, so in the relay log
we will have "[0, 100] U [150, infinity[" and nobody will notice it, so the
SQL thread will jump from 100 to 150, and replication will silently break.
When we come to this place in code, relay log may or not be initialized;
the caller is responsible for setting 'flush_relay_log_cache' accordingly.
*/
if
(
flush_relay_log_cache
)
flush_io_cache
(
mi
->
rli
.
relay_log
.
get_log_file
());
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
...
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