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
c5d7c038
Commit
c5d7c038
authored
Dec 10, 2008
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
push to 5.1-buteam tree.
parents
5b924b32
0c9aaecc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
215 additions
and
86 deletions
+215
-86
mysql-test/include/wait_until_connected_again.inc
mysql-test/include/wait_until_connected_again.inc
+1
-1
mysql-test/r/binlog_index.result
mysql-test/r/binlog_index.result
+1
-0
mysql-test/suite/rpl/r/rpl_crash_before_purge_logs.result
mysql-test/suite/rpl/r/rpl_crash_before_purge_logs.result
+14
-0
mysql-test/suite/rpl/t/rpl_crash_before_purge_logs.test
mysql-test/suite/rpl/t/rpl_crash_before_purge_logs.test
+57
-0
sql/log.cc
sql/log.cc
+135
-85
sql/log.h
sql/log.h
+7
-0
No files found.
mysql-test/include/wait_until_connected_again.inc
View file @
c5d7c038
...
...
@@ -6,7 +6,7 @@
let
$counter
=
500
;
while
(
$mysql_errno
)
{
--
error
0
,
2002
,
2006
,
2013
--
error
0
,
2002
,
200
3
,
200
6
,
2013
show
status
;
dec
$counter
;
...
...
mysql-test/r/binlog_index.result
View file @
c5d7c038
...
...
@@ -21,6 +21,7 @@ flush logs;
*** must be a warning master-bin.000001 was not found ***
Warnings:
Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
*** must show one record, of the active binlog, left in the index file after PURGE ***
show binary logs;
Log_name File_size
...
...
mysql-test/suite/rpl/r/rpl_crash_before_purge_logs.result
0 → 100644
View file @
c5d7c038
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT);
start slave;
SET GLOBAL debug= "+d,crash_before_purge_logs";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
start slave;
mysql-test/suite/rpl/t/rpl_crash_before_purge_logs.test
0 → 100644
View file @
c5d7c038
--
source
include
/
master
-
slave
.
inc
--
source
include
/
have_debug
.
inc
--
disable_reconnect
# We have to sync with master, to ensure slave had time to start properly
# # before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the
# log.
sync_slave_with_master
;
stop
slave
;
--
source
include
/
wait_for_slave_to_stop
.
inc
# ON MASTER
connection
master
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
id
INT
);
let
$
1
=
100
;
disable_query_log
;
begin
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
VALUES
(
$
1
);
dec
$
1
;
}
DROP
TABLE
t1
;
save_master_pos
;
enable_query_log
;
## ON SLAVE
connection
slave
;
start
slave
;
--
source
include
/
wait_for_slave_to_start
.
inc
sync_with_master
0
;
connection
master
;
save_master_pos
;
connection
slave
;
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
slave0
.
expect
SET
GLOBAL
debug
=
"+d,crash_before_purge_logs"
;
--
error
2013
# try to rotate logs
FLUSH
LOGS
;
--
enable_reconnect
--
source
include
/
wait_until_connected_again
.
inc
start
slave
;
--
source
include
/
wait_for_slave_to_start
.
inc
sync_with_master
0
;
sql/log.cc
View file @
c5d7c038
This diff is collapsed.
Click to expand it.
sql/log.h
View file @
c5d7c038
...
...
@@ -233,6 +233,13 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
pthread_cond_t
update_cond
;
ulonglong
bytes_written
;
IO_CACHE
index_file
;
/*
purge_temp is a temp file used in purge_logs so that the index file
can be updated before deleting files from disk, yielding better crash
recovery. It is created on demand the first time purge_logs is called
and then reused for subsequent calls. It is cleaned up in cleanup().
*/
IO_CACHE
purge_temp
;
char
index_file_name
[
FN_REFLEN
];
/*
The max size before rotation (usable only if log_type == LOG_BIN: binary
...
...
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