Merge lp:~sergei.glushchenko/percona-xtrabackup/xb21-bug976945 into lp:percona-xtrabackup/2.1

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 419
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/xb21-bug976945
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 125 lines (+69/-20)
2 files modified
src/xtrabackup.c (+34/-20)
test/t/bug976945.sh (+35/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/xb21-bug976945
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+110473@code.launchpad.net

Description of the change

Bug976945: innodb_log_block_size=4096 is not supported
When called with --prepare xtrabackup didn't initialize
log_block_size properly.
Solution is to initialize log_block_size from inside
xtrabackup_init_temp_log when --prepare called.

#24231

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Approved. In the future, when you're merging a revision from a lower version branch, just say it's a merge in revision comments, there's no need to duplicate the revision comment from that branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/xtrabackup.c'
--- src/xtrabackup.c 2012-06-14 14:48:55 +0000
+++ src/xtrabackup.c 2012-06-18 03:45:25 +0000
@@ -681,7 +681,7 @@
681 (G_PTR*) &innobase_page_size, (G_PTR*) &innobase_page_size, 0,681 (G_PTR*) &innobase_page_size, (G_PTR*) &innobase_page_size, 0,
682 GET_LONG, REQUIRED_ARG, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},682 GET_LONG, REQUIRED_ARG, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},
683 {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,683 {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,
684 "###EXPERIMENTAL###: The log block size of the transaction log file. "684 "The log block size of the transaction log file. "
685 "Changing for created log file is not supported. Use on your own risk!",685 "Changing for created log file is not supported. Use on your own risk!",
686 (G_PTR*) &innobase_log_block_size, (G_PTR*) &innobase_log_block_size, 0,686 (G_PTR*) &innobase_log_block_size, (G_PTR*) &innobase_log_block_size, 0,
687 GET_ULONG, REQUIRED_ARG, 512, 512, 1 << UNIV_PAGE_SIZE_SHIFT_MAX, 0, 1L, 0},687 GET_ULONG, REQUIRED_ARG, 512, 512, 1 << UNIV_PAGE_SIZE_SHIFT_MAX, 0, 1L, 0},
@@ -862,6 +862,34 @@
862 return 0;862 return 0;
863}863}
864864
865/***********************************************************************
866Initializes log_block_size*/
867static
868ibool
869xb_init_log_block_size(void)
870{
871#ifdef XTRADB_BASED
872 srv_log_block_size = 0;
873 if (innobase_log_block_size != 512) {
874 uint n_shift = get_bit_shift(innobase_log_block_size);;
875
876 if (n_shift > 0) {
877 srv_log_block_size = (1 << n_shift);
878 msg("InnoDB: The log block size is set to %lu.\n",
879 srv_log_block_size);
880 }
881 } else {
882 srv_log_block_size = 512;
883 }
884 if (!srv_log_block_size) {
885 msg("InnoDB: Error: %lu is not valid value for "
886 "innodb_log_block_size.\n", innobase_log_block_size);
887 return FALSE;
888 }
889#endif
890 return TRUE;
891}
892
865static my_bool893static my_bool
866innodb_init_param(void)894innodb_init_param(void)
867{895{
@@ -903,25 +931,7 @@
903 srv_page_size = (1 << srv_page_size_shift);931 srv_page_size = (1 << srv_page_size_shift);
904 }932 }
905933
906 srv_log_block_size = 0;934 if (!xb_init_log_block_size()) {
907 if (innobase_log_block_size != 512) {
908 uint n_shift = get_bit_shift(innobase_log_block_size);;
909
910 msg("InnoDB: Warning: innodb_log_block_size has "
911 "been changed from its default value. "
912 "(###EXPERIMENTAL### operation)\n");
913 if (n_shift > 0) {
914 srv_log_block_size = (1 << n_shift);
915 msg("InnoDB: The log block size is set to %lu.\n",
916 srv_log_block_size);
917 }
918 } else {
919 srv_log_block_size = 512;
920 }
921
922 if (!srv_log_block_size) {
923 msg("InnoDB: Error: %lu is not valid value for "
924 "innodb_log_block_size.\n", innobase_log_block_size);
925 goto error;935 goto error;
926 }936 }
927937
@@ -3402,6 +3412,10 @@
34023412
3403 max_no = ut_dulint_zero;3413 max_no = ut_dulint_zero;
34043414
3415 if (!xb_init_log_block_size()) {
3416 goto error;
3417 }
3418
3405 if(!xtrabackup_incremental_dir) {3419 if(!xtrabackup_incremental_dir) {
3406 sprintf(dst_path, "%s/ib_logfile0", xtrabackup_target_dir);3420 sprintf(dst_path, "%s/ib_logfile0", xtrabackup_target_dir);
3407 sprintf(src_path, "%s/%s", xtrabackup_target_dir,3421 sprintf(src_path, "%s/%s", xtrabackup_target_dir,
34083422
=== added file 'test/t/bug976945.sh'
--- test/t/bug976945.sh 1970-01-01 00:00:00 +0000
+++ test/t/bug976945.sh 2012-06-18 03:45:25 +0000
@@ -0,0 +1,35 @@
1############################################################################
2# Bug #976945: innodb_log_block_size=4096 is not supported
3############################################################################
4. inc/common.sh
5
6if [ -z "$XTRADB_VERSION" ]; then
7 echo "Requires XtraDB" > $SKIPPED_REASON
8 exit $SKIPPED_EXIT_CODE
9fi
10
11start_server --innodb_log_block_size=4096
12echo innodb_log_block_size=4096 >> ${MYSQLD_VARDIR}/my.cnf
13load_sakila
14
15# Full backup
16vlog "Starting backup"
17
18full_backup_dir=${MYSQLD_VARDIR}/full_backup
19innobackupex --no-timestamp $full_backup_dir
20
21vlog "Preparing backup"
22innobackupex --apply-log --redo-only $full_backup_dir
23vlog "Log applied to full backup"
24
25# Destroying mysql data
26stop_server
27rm -rf $mysql_datadir/*
28vlog "Data destroyed"
29
30# Restore backup
31vlog "Copying files to their original locations"
32innobackupex --copy-back $full_backup_dir
33vlog "Data restored"
34
35start_server --innodb_log_block_size=4096

Subscribers

People subscribed via source and target branches