Merge lp:~akopytov/percona-xtrabackup/bug1097158-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 475
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1097158-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 76 lines (+23/-13)
2 files modified
src/xtrabackup.c (+3/-0)
test/t/xb_log_overwrap.sh (+20/-13)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1097158-2.1
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Registry Administrators Pending
Review via email: mp+142292@code.launchpad.net

Description of the change

  Bug #1097158: xb_log_overwrap fails sporadically in Jenkin

  The test case tries to generate enough log writes to cause the log files
  wrap around and make xtrabackup fail with an error.

  Found 2 potential problems:

  - the test used the default log buffer size. Which, for an InnoDB
    plugin's default 8M buffer size, means there may be not enough changes
    in the on-disk files to trigger the expected error
  - the test suspended the main xtrabackup thread, but not the log copying
    thread. Which means the log copying thread could be catching up in the
    background and avoid reading wrapped-around log entries, and thus, the
    expected error.

  Fixed by setting an explicit log buffer size to the minimum value (1M)
  and using debug sync to suspend log copying thread, rather than the main
  one.

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.1-param/141/

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/xtrabackup.c'
2--- src/xtrabackup.c 2012-11-21 13:51:49 +0000
3+++ src/xtrabackup.c 2013-01-08 11:36:03 +0000
4@@ -1923,6 +1923,9 @@
5
6 /* innodb_mirrored_log_groups must be 1, no other groups */
7 ut_a(group == NULL);
8+
9+ debug_sync_point("xtrabackup_copy_logfile_pause");
10+
11 }
12
13
14
15=== modified file 'test/t/xb_log_overwrap.sh'
16--- test/t/xb_log_overwrap.sh 2012-06-05 12:35:33 +0000
17+++ test/t/xb_log_overwrap.sh 2013-01-08 11:36:03 +0000
18@@ -1,38 +1,45 @@
19 . inc/common.sh
20
21-start_server --innodb_log_file_size=1M --innodb_thread_concurrency=1
22+if ! $XB_BIN --help 2>&1 | grep -q debug-sync; then
23+ echo "Requires --debug-sync support" > $SKIPPED_REASON
24+ exit $SKIPPED_EXIT_CODE
25+fi
26+
27+start_server --innodb_log_file_size=1M --innodb_thread_concurrency=1 \
28+ --innodb_log_buffer_size=1M
29
30 load_dbase_schema sakila
31 load_dbase_data sakila
32 mkdir $topdir/backup
33
34 run_cmd_expect_failure $XB_BIN $XB_ARGS --datadir=$mysql_datadir --backup \
35- --innodb_log_file_size=1M --target-dir=$topdir/backup --suspend-at-end &
36-
37-xb_pid=$!
38+ --innodb_log_file_size=1M --target-dir=$topdir/backup \
39+ --debug-sync="xtrabackup_copy_logfile_pause" &
40+
41+job_pid=$!
42+
43+pid_file=$topdir/backup/xtrabackup_debug_sync
44
45 # Wait for xtrabackup to suspend
46 i=0
47-while [ ! -r $topdir/backup/xtrabackup_suspended ]
48+while [ ! -r "$pid_file" ]
49 do
50 sleep 1
51 i=$((i+1))
52- echo "Waited $i seconds for xtrabackup_suspended to be created"
53+ echo "Waited $i seconds for $pid_file to be created"
54 done
55
56-# Stop the xtrabackup process
57-kill -SIGSTOP $xb_pid
58-
59-# Create 2M+ of log data
60+xb_pid=`cat $pid_file`
61+
62+# Create 4M+ of log data
63
64 $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE tmp1 ENGINE=InnoDB SELECT * FROM payment" sakila
65 $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE tmp2 ENGINE=InnoDB SELECT * FROM payment" sakila
66 $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE tmp3 ENGINE=InnoDB SELECT * FROM payment" sakila
67
68 # Resume the xtrabackup process
69+vlog "Resuming xtrabackup"
70 kill -SIGCONT $xb_pid
71
72-rm -f $topdir/backup/xtrabackup_suspended
73-
74 # wait's return code will be the code returned by the background process
75-wait $xb_pid
76+run_cmd wait $job_pid

Subscribers

People subscribed via source and target branches

to all changes: