Merge lp:~akopytov/percona-server/bug901775-5.5 into lp:percona-server/5.5

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 199
Merged at revision: 199
Proposed branch: lp:~akopytov/percona-server/bug901775-5.5
Merge into: lp:percona-server/5.5
Diff against target: 128 lines (+76/-3)
1 file modified
patches/innodb_expand_import.patch (+76/-3)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug901775-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+85217@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

http://jenkins.percona.com/view/Percona Server 5.5/job/percona-server-5.5-param/214/

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

LGTM, thank you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/innodb_expand_import.patch'
2--- patches/innodb_expand_import.patch 2011-11-14 10:30:04 +0000
3+++ patches/innodb_expand_import.patch 2011-12-10 10:41:26 +0000
4@@ -136,7 +136,20 @@
5 Tries to open a single-table tablespace and optionally checks the space id is
6 right in it. If does not succeed, prints an error message to the .err log. This
7 function is used to open a tablespace when we start up mysqld, and also in
8-@@ -3079,7 +3165,7 @@
9+@@ -3055,8 +3141,11 @@
10+ accessing the first page of the file */
11+ ulint id, /*!< in: space id */
12+ ulint flags, /*!< in: tablespace flags */
13+- const char* name) /*!< in: table name in the
14++ const char* name, /*!< in: table name in the
15+ databasename/tablename format */
16++ trx_t* trx) /*!< in: transaction. This is only used
17++ for IMPORT TABLESPACE, must be NULL
18++ otherwise */
19+ {
20+ os_file_t file;
21+ char* filepath;
22+@@ -3079,7 +3168,7 @@
23
24 file = os_file_create_simple_no_error_handling(
25 innodb_file_data_key, filepath, OS_FILE_OPEN,
26@@ -145,7 +158,7 @@
27 if (!success) {
28 /* The following call prints an error message */
29 os_file_get_last_error(TRUE);
30-@@ -3126,6 +3212,445 @@
31+@@ -3126,6 +3215,453 @@
32 space_id = fsp_header_get_space_id(page);
33 space_flags = fsp_header_get_flags(page);
34
35@@ -297,6 +310,11 @@
36 + /* over write space id of all pages */
37 + rec_offs_init(offsets_);
38 +
39++ /* Unlock the data dictionary to not block queries
40++ accessing other tables */
41++ ut_a(trx);
42++ row_mysql_unlock_data_dictionary(trx);
43++
44 + fprintf(stderr, "InnoDB: Progress in %%:");
45 +
46 + for (offset = 0; offset < free_limit_bytes;
47@@ -498,6 +516,9 @@
48 +
49 + fprintf(stderr, " done.\n");
50 +
51++ /* Reacquire the data dictionary lock */
52++ row_mysql_lock_data_dictionary(trx);
53++
54 + /* update SYS_INDEXES set root page */
55 + index = dict_table_get_first_index(table);
56 + while (index) {
57@@ -591,7 +612,7 @@
58 ut_free(buf2);
59
60 if (UNIV_UNLIKELY(space_id != id
61-@@ -3167,6 +3692,271 @@
62+@@ -3167,6 +3703,271 @@
63 os_file_close(file);
64 mem_free(filepath);
65
66@@ -1039,6 +1060,15 @@
67 /* It is possible, though very improbable, that the lsn's in the
68 tablespace to be imported have risen above the current system lsn, if
69 a lengthy purge, ibuf merge, or rollback was performed on a backup
70+@@ -2632,7 +2637,7 @@
71+ success = fil_open_single_table_tablespace(
72+ TRUE, table->space,
73+ table->flags == DICT_TF_COMPACT ? 0 : table->flags,
74+- table->name);
75++ table->name, trx);
76+ if (success) {
77+ table->ibd_file_missing = FALSE;
78+ table->tablespace_discarded = FALSE;
79 @@ -2658,6 +2663,11 @@
80
81 trx->op_info = "";
82@@ -1062,3 +1092,46 @@
83 UNIV_INTERN ulint srv_dict_size_limit = 0;
84 /*-------------------------------------------*/
85 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
86+--- a/storage/innobase/dict/dict0load.c
87++++ b/storage/innobase/dict/dict0load.c
88+@@ -778,7 +778,7 @@
89+ object and check that the .ibd file exists. */
90+
91+ fil_open_single_table_tablespace(FALSE, space_id,
92+- flags, name);
93++ flags, name, NULL);
94+ }
95+
96+ mem_free(name);
97+@@ -1833,7 +1833,7 @@
98+ if (!fil_open_single_table_tablespace(
99+ TRUE, table->space,
100+ table->flags == DICT_TF_COMPACT ? 0 :
101+- table->flags & ~(~0 << DICT_TF_BITS), name)) {
102++ table->flags & ~(~0 << DICT_TF_BITS), name, NULL)) {
103+ /* We failed to find a sensible
104+ tablespace file */
105+
106+--- a/storage/innobase/include/fil0fil.h
107++++ b/storage/innobase/include/fil0fil.h
108+@@ -34,6 +34,7 @@
109+ #include "sync0rw.h"
110+ #include "ibuf0types.h"
111+ #endif /* !UNIV_HOTBACKUP */
112++#include "trx0types.h"
113+
114+ /** When mysqld is run, the default directory "." is the mysqld datadir,
115+ but in the MySQL Embedded Server Library and ibbackup it is not the default
116+@@ -473,8 +474,11 @@
117+ accessing the first page of the file */
118+ ulint id, /*!< in: space id */
119+ ulint flags, /*!< in: tablespace flags */
120+- const char* name); /*!< in: table name in the
121++ const char* name, /*!< in: table name in the
122+ databasename/tablename format */
123++ trx_t* trx); /*!< in: transaction. This is only used
124++ for IMPORT TABLESPACE, must be NULL
125++ otherwise */
126+ /********************************************************************//**
127+ It is possible, though very improbable, that the lsn's in the tablespace to be
128+ imported have risen above the current system lsn, if a lengthy purge, ibuf

Subscribers

People subscribed via source and target branches