Merge lp:~sergei.glushchenko/percona-xtrabackup/ST-25967-2.1 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: 455
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/ST-25967-2.1
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~sergei.glushchenko/percona-xtrabackup/BT-26901-2.1
Diff against target: 235 lines (+147/-37)
4 files modified
src/innodb_int.c (+39/-0)
src/innodb_int.h (+7/-0)
src/xtrabackup.c (+4/-37)
test/t/bug1062684.sh (+97/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/ST-25967-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+134638@code.launchpad.net

This proposal supersedes a proposal from 2012-10-22.

Description of the change

Same as for 2.0

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal

#25967

Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Same comment as in the 2.0 MP.

review: Needs Information
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/innodb_int.c'
--- src/innodb_int.c 2012-09-13 12:24:01 +0000
+++ src/innodb_int.c 2012-11-16 11:26:25 +0000
@@ -294,6 +294,45 @@
294 return TRUE;294 return TRUE;
295}295}
296296
297/*********************************************************************//**
298Normalizes init parameter values to use units we use inside InnoDB.
299@return DB_SUCCESS or error code */
300void
301xb_normalize_init_values(void)
302/*==========================*/
303{
304 ulint i;
305
306 for (i = 0; i < srv_n_data_files; i++) {
307 srv_data_file_sizes[i] = srv_data_file_sizes[i]
308 * ((1024 * 1024) / UNIV_PAGE_SIZE);
309 }
310
311 srv_last_file_size_max = srv_last_file_size_max
312 * ((1024 * 1024) / UNIV_PAGE_SIZE);
313
314 srv_log_file_size = srv_log_file_size / UNIV_PAGE_SIZE;
315
316 srv_log_buffer_size = srv_log_buffer_size / UNIV_PAGE_SIZE;
317
318#ifndef INNODB_VERSION_SHORT
319 srv_pool_size = srv_pool_size / (UNIV_PAGE_SIZE / 1024);
320
321 srv_awe_window_size = srv_awe_window_size / UNIV_PAGE_SIZE;
322
323 if (srv_use_awe) {
324 /* If we are using AWE we must save memory in the 32-bit
325 address space of the process, and cannot bind the lock
326 table size to the real buffer pool size. */
327
328 srv_lock_table_size = 20 * srv_awe_window_size;
329 } else {
330 srv_lock_table_size = 5 * srv_pool_size;
331 }
332#else
333 srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE);
334#endif
335}
297336
298#ifndef INNODB_VERSION_SHORT337#ifndef INNODB_VERSION_SHORT
299338
300339
=== modified file 'src/innodb_int.h'
--- src/innodb_int.h 2012-09-13 12:24:01 +0000
+++ src/innodb_int.h 2012-11-16 11:26:25 +0000
@@ -625,6 +625,13 @@
625 flags */625 flags */
626 os_file_t* file); /*!<out: file handle */626 os_file_t* file); /*!<out: file handle */
627627
628/*********************************************************************//**
629Normalizes init parameter values to use units we use inside InnoDB.
630@return DB_SUCCESS or error code */
631void
632xb_normalize_init_values(void);
633/*==========================*/
634
628#ifndef INNODB_VERSION_SHORT635#ifndef INNODB_VERSION_SHORT
629636
630/********************************************************************//**637/********************************************************************//**
631638
=== modified file 'src/xtrabackup.c'
--- src/xtrabackup.c 2012-11-16 11:26:25 +0000
+++ src/xtrabackup.c 2012-11-16 11:26:25 +0000
@@ -2493,6 +2493,8 @@
2493 if(innodb_init_param())2493 if(innodb_init_param())
2494 exit(EXIT_FAILURE);2494 exit(EXIT_FAILURE);
24952495
2496 xb_normalize_init_values();
2497
2496#ifndef __WIN__2498#ifndef __WIN__
2497 if (srv_file_flush_method_str == NULL) {2499 if (srv_file_flush_method_str == NULL) {
2498 /* These are the default options */2500 /* These are the default options */
@@ -2570,43 +2572,6 @@
2570 computers */2572 computers */
2571 }2573 }
25722574
2573 {
2574 ulint nr;
2575 ulint i;
2576
2577 nr = srv_n_data_files;
2578
2579 for (i = 0; i < nr; i++) {
2580 srv_data_file_sizes[i] = srv_data_file_sizes[i]
2581 * ((1024 * 1024) / UNIV_PAGE_SIZE);
2582 }
2583
2584 srv_last_file_size_max = srv_last_file_size_max
2585 * ((1024 * 1024) / UNIV_PAGE_SIZE);
2586
2587 srv_log_file_size = srv_log_file_size / UNIV_PAGE_SIZE;
2588
2589 srv_log_buffer_size = srv_log_buffer_size / UNIV_PAGE_SIZE;
2590
2591#ifndef INNODB_VERSION_SHORT
2592 srv_pool_size = srv_pool_size / (UNIV_PAGE_SIZE / 1024);
2593
2594 srv_awe_window_size = srv_awe_window_size / UNIV_PAGE_SIZE;
2595
2596 if (srv_use_awe) {
2597 /* If we are using AWE we must save memory in the 32-bit
2598 address space of the process, and cannot bind the lock
2599 table size to the real buffer pool size. */
2600
2601 srv_lock_table_size = 20 * srv_awe_window_size;
2602 } else {
2603 srv_lock_table_size = 5 * srv_pool_size;
2604 }
2605#else
2606 srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE);
2607#endif
2608 }
2609
2610 os_sync_mutex = NULL;2575 os_sync_mutex = NULL;
2611 srv_general_init();2576 srv_general_init();
26122577
@@ -4497,6 +4462,8 @@
4497 if(innodb_init_param())4462 if(innodb_init_param())
4498 goto error;4463 goto error;
44994464
4465 xb_normalize_init_values();
4466
4500 mem_init(srv_mem_pool_size);4467 mem_init(srv_mem_pool_size);
4501 if (xtrabackup_incremental) {4468 if (xtrabackup_incremental) {
4502 err = xb_data_files_init();4469 err = xb_data_files_init();
45034470
=== added file 'test/t/bug1062684.sh'
--- test/t/bug1062684.sh 1970-01-01 00:00:00 +0000
+++ test/t/bug1062684.sh 2012-11-16 11:26:25 +0000
@@ -0,0 +1,97 @@
1. inc/common.sh
2
3start_server --innodb-data-file-path="ibdata1:10M;ibdata2:5M:autoextend"
4load_dbase_schema incremental_sample
5
6echo "innodb-data-file-path=ibdata1:10M;ibdata2:5M:autoextend" >>$topdir/my.cnf
7
8# Adding initial rows
9vlog "Adding initial rows to database..."
10${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample
11
12# Full backup
13# backup root directory
14mkdir -p $topdir/backup
15
16vlog "Starting backup"
17innobackupex $topdir/backup
18full_backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{print $2}'`
19vlog "Full backup done to directory $full_backup_dir"
20
21# Changing data
22
23vlog "Making changes to database"
24${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
25${MYSQL} ${MYSQL_ARGS} -e "insert into test values (10, 1);" incremental_sample
26${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values (10, 1);" incremental_sample
27vlog "Changes done"
28
29# Saving the checksum of original table
30checksum_test_a=`checksum_table incremental_sample test`
31checksum_t2_a=`checksum_table incremental_sample t2`
32vlog "Table 'test' checksum is $checksum_test_a"
33vlog "Table 't2' checksum is $checksum_t2_a"
34
35vlog "Making incremental backup"
36
37vlog "###############"
38vlog "# INCREMENTAL #"
39vlog "###############"
40
41# Incremental backup
42innobackupex --incremental --incremental-basedir=$full_backup_dir \
43 $topdir/backup
44inc_backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | tail -n 1 | awk -F\' '{print $2}'`
45vlog "Incremental backup done to directory $inc_backup_dir"
46
47vlog "Preparing backup"
48# Prepare backup
49vlog "##############"
50vlog "# PREPARE #1 #"
51vlog "##############"
52innobackupex --apply-log --redo-only $full_backup_dir
53vlog "Log applied to full backup"
54vlog "##############"
55vlog "# PREPARE #2 #"
56vlog "##############"
57innobackupex --apply-log --redo-only --incremental-dir=$inc_backup_dir \
58 $full_backup_dir
59vlog "Delta applied to full backup"
60vlog "##############"
61vlog "# PREPARE #3 #"
62vlog "##############"
63innobackupex --apply-log $full_backup_dir
64vlog "Data prepared for restore"
65
66# Destroying mysql data
67stop_server
68rm -rf $mysql_datadir/*
69vlog "Data destroyed"
70
71# Restore backup
72vlog "Copying files"
73vlog "###########"
74vlog "# RESTORE #"
75vlog "###########"
76innobackupex --copy-back $full_backup_dir
77vlog "Data restored"
78
79start_server --innodb-data-file-path="ibdata1:10M;ibdata2:5M:autoextend"
80
81vlog "Checking checksums"
82checksum_test_b=`checksum_table incremental_sample test`
83checksum_t2_b=`checksum_table incremental_sample t2`
84
85if [ "$checksum_test_a" != "$checksum_test_b" ]
86then
87 vlog "Checksums for table 'test' are not equal"
88 exit -1
89fi
90
91if [ "$checksum_t2_a" != "$checksum_t2_b" ]
92then
93 vlog "Checksums for table 't2' are not equal"
94 exit -1
95fi
96
97vlog "Checksums are OK"

Subscribers

People subscribed via source and target branches