Merge lp:~laurynas-biveinis/percona-server/bug1105709-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 424
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1105709-5.5
Merge into: lp:percona-server/5.5
Prerequisite: lp:~laurynas-biveinis/percona-server/BT-16274-bug1083669-5.5
Diff against target: 190 lines (+150/-6)
3 files modified
Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_flush.result (+19/-0)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_flush.test (+93/-0)
Percona-Server/storage/innobase/log/log0online.c (+38/-6)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1105709-5.5
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
George Ormond Lorch III (community) g2 Approve
Review via email: mp+145802@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

Minor comment spelling on diff line 162 /shoul/should

review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Will fix, thanks.

Revision history for this message
Stewart Smith (stewart) :
review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Fixed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_flush.result'
--- Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_flush.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_flush.result 2013-02-06 09:09:23 +0000
@@ -0,0 +1,19 @@
1DROP TABLE IF EXISTS t1;
2RESET CHANGED_PAGE_BITMAPS;
3CREATE TABLE t1 (a INT, b BLOB) ENGINE=InnoDB;
4INSERT INTO t1 VALUES (1, REPEAT("a", 20000));
5ib_modified_log_1
6INSERT INTO t1 VALUES (2, REPEAT("b", 20000));
7ib_modified_log_1
8ib_modified_log_2
9INSERT INTO t1 VALUES (3, REPEAT("c", 20000));
10ib_modified_log_1
11ib_modified_log_2
12ib_modified_log_3
13INSERT INTO t1 VALUES (4, REPEAT("d", 20000));
14ib_modified_log_1
15ib_modified_log_2
16ib_modified_log_3
17ib_modified_log_4
18RESET CHANGED_PAGE_BITMAPS;
19DROP TABLE t1;
020
=== added file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_flush.test'
--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_flush.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_flush.test 2013-02-06 09:09:23 +0000
@@ -0,0 +1,93 @@
1#
2# Test the interaction between innodb_flush_method and bitmap file writes
3#
4--source include/not_windows.inc
5--source include/have_innodb.inc
6
7let $MYSQLD_DATADIR= `select @@datadir`;
8let $BITMAP_FILE= $MYSQLD_DATADIR/ib_modified_log_1_0.xdb;
9
10--disable_warnings
11DROP TABLE IF EXISTS t1;
12--enable_warnings
13
14RESET CHANGED_PAGE_BITMAPS;
15
16CREATE TABLE t1 (a INT, b BLOB) ENGINE=InnoDB;
17
18#
19# Test innodb_flush_method=fdatasync (the default)
20#
21--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
22--shutdown_server 10
23--source include/wait_until_disconnected.inc
24--enable_reconnect
25--exec echo "restart:--innodb-track-changed-pages=1" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
26--source include/wait_until_connected_again.inc
27
28INSERT INTO t1 VALUES (1, REPEAT("a", 20000));
29
30#
31# Test innodb_flush_method=O_DSYNC
32# Check that the previous test produced bitmap data while the server is down.
33#
34--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
35--shutdown_server 10
36--source include/wait_until_disconnected.inc
37file_exists $BITMAP_FILE;
38# Here and below remove the LSNs from the file names on listing them
39--replace_regex /_[[:digit:]]+\.xdb$//
40list_files $MYSQLD_DATADIR ib_modified_log*;
41--enable_reconnect
42--exec echo "restart:--innodb-track-changed-pages=1 --innodb-flush-method=O_DSYNC" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
43--source include/wait_until_connected_again.inc
44
45INSERT INTO t1 VALUES (2, REPEAT("b", 20000));
46
47#
48# Test innodb_flush_method=O_DIRECT
49# Check that the previous test produced bitmap data while the server is down.
50#
51--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
52--shutdown_server 10
53--source include/wait_until_disconnected.inc
54file_exists $BITMAP_FILE;
55--replace_regex /_[[:digit:]]+\.xdb$//
56list_files $MYSQLD_DATADIR ib_modified_log*;
57--enable_reconnect
58--exec echo "restart:--innodb-track-changed-pages=1 --innodb-flush-method=O_DIRECT" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
59--source include/wait_until_connected_again.inc
60
61INSERT INTO t1 VALUES (3, REPEAT("c", 20000));
62
63#
64# Test innodb_flush_method=O_DIRECT
65# Check that the previous test produced bitmap data while the server is down.
66#
67--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
68--shutdown_server 10
69--source include/wait_until_disconnected.inc
70file_exists $BITMAP_FILE;
71--replace_regex /_[[:digit:]]+\.xdb$//
72list_files $MYSQLD_DATADIR ib_modified_log*;
73--enable_reconnect
74--exec echo "restart:--innodb-track-changed-pages=1 --innodb-flush-method=O_DIRECT" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
75--source include/wait_until_connected_again.inc
76
77INSERT INTO t1 VALUES (4, REPEAT("d", 20000));
78
79#
80# Restart the server with default options
81#
82--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
83--shutdown_server 10
84--source include/wait_until_disconnected.inc
85file_exists $BITMAP_FILE;
86--replace_regex /_[[:digit:]]+\.xdb$//
87list_files $MYSQLD_DATADIR ib_modified_log*;
88--enable_reconnect
89--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
90--source include/wait_until_connected_again.inc
91
92RESET CHANGED_PAGE_BITMAPS;
93DROP TABLE t1;
094
=== modified file 'Percona-Server/storage/innobase/log/log0online.c'
--- Percona-Server/storage/innobase/log/log0online.c 2013-02-05 12:08:26 +0000
+++ Percona-Server/storage/innobase/log/log0online.c 2013-02-06 09:09:23 +0000
@@ -496,6 +496,23 @@
496}496}
497497
498/*********************************************************************//**498/*********************************************************************//**
499Check if an old file that has the name of a new bitmap file we are about to
500create should be overwritten. */
501static
502ibool
503log_online_should_overwrite(
504/*========================*/
505 const char *path) /*!< in: path to file */
506{
507 ibool success;
508 os_file_stat_t file_info;
509
510 /* Currently, it's OK to overwrite 0-sized files only */
511 success = os_file_get_status(path, &file_info);
512 return success && file_info.size == 0LL;
513}
514
515/*********************************************************************//**
499Create a new empty bitmap output file.516Create a new empty bitmap output file.
500517
501@return TRUE if operation succeeded, FALSE if I/O error */518@return TRUE if operation succeeded, FALSE if I/O error */
@@ -504,12 +521,22 @@
504log_online_start_bitmap_file(void)521log_online_start_bitmap_file(void)
505/*==============================*/522/*==============================*/
506{523{
507 ibool success;524 ibool success = TRUE;
508525
509 log_bmp_sys->out.file526 /* Check for an old file that should be deleted first */
510 = os_file_create(innodb_file_bmp_key, log_bmp_sys->out.name,527 if (log_online_should_overwrite(log_bmp_sys->out.name)) {
511 OS_FILE_OVERWRITE, OS_FILE_NORMAL,528 success = os_file_delete(log_bmp_sys->out.name);
512 OS_DATA_FILE, &success);529 }
530
531 if (UNIV_LIKELY(success)) {
532 log_bmp_sys->out.file
533 = os_file_create_simple_no_error_handling(
534 innodb_file_bmp_key,
535 log_bmp_sys->out.name,
536 OS_FILE_CREATE,
537 OS_FILE_READ_WRITE,
538 &success);
539 }
513 if (UNIV_UNLIKELY(!success)) {540 if (UNIV_UNLIKELY(!success)) {
514541
515 /* The following call prints an error message */542 /* The following call prints an error message */
@@ -1078,6 +1105,11 @@
1078 return FALSE;1105 return FALSE;
1079 }1106 }
10801107
1108#ifdef UNIV_LINUX
1109 posix_fadvise(log_bmp_sys->out.file, log_bmp_sys->out.offset,
1110 MODIFIED_PAGE_BLOCK_SIZE, POSIX_FADV_DONTNEED);
1111#endif
1112
1081 log_bmp_sys->out.offset += MODIFIED_PAGE_BLOCK_SIZE;1113 log_bmp_sys->out.offset += MODIFIED_PAGE_BLOCK_SIZE;
1082 return TRUE;1114 return TRUE;
1083}1115}

Subscribers

People subscribed via source and target branches