Skip to content

Commit 6dec2d0

Browse files
committedNov 15, 2016
Bug #24462978: Free up 32 slots in TRX_SYS page for non-temp rsegs
This is a preliminary patch for WL#6966-InnoDB: Flexible UNDO tablespace management There are 32 slots in the TRX_SYS page that are not being used. The slot numbers are reserved for rseg_ids of rollback segments in the temporary tablespace. The space_id & page number of these rollback segments will never be stored persistently. In this patch, these slots are moved to a separate in-memory array of rsegs so that these 32 slots in TRX_SYS can be used for durable rollback segments. This is a nonfunctional change which allows parts of wl9507 to be reviewed and tested separately with the current set of test cases so that we can be confident that these changes are clean. So in addition to the new container for temporary rollback segments, this patch contains the following, some of which are explained in WL#9507 * Add and improve comments for clarity. * Change the preferred terminology from 'undo_log' to 'rollback segment' when that is what it refers to. 'Undo log' has another meaning. * Use an std::vector as a container for undo tablespaces so that this list can grow and shrink without introducing array gaps. In wl#9507, the translation between an rseg_id from a rollback pointer to a space_id will be just a simple math function since the rseg_id will be a 7-bit number and the undo space_id will be a reserved range of tablespace IDs. * Use an std::vector as a container for trx_rseg_t objects consistently. The purge list is already using this kind of container. * Reorganize srv_undo_tablespace_init() so that it can be easily expanded in wl#9507 by putting various tasks into their own functions. * Combine the functions that build rollback segments. * Combine the effort to construct FSP headers and rollback segments after an undo tablespace is created, or fixed-up from a failed truncate. This will make it easier to upgrade undo tablespaces on startup and add rollback segments when needed. The undo::Truncate class used two different vectors of space_ids but those vectors can be combined because they never overlap in usage. One is at startup and the other is during runtime. * Introduce the class undo::Tablespace to handle the just-in-time creation of undo_name and undo_file_name from a space_id. This collects this repeated code to one location and reduces how often it is done. This will be expanded further in wl9507 to handle the conversion of an undo space_id to an undo space_num. It will also contain a vector of rseg objects for each undo tablespace. Approved by Thiru in RB#13164
1 parent a8c341b commit 6dec2d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1531
-1563
lines changed
 

‎mysql-test/suite/innodb/t/bootstrap.test

+4-8
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,19 @@ let SEARCH_PATTERN=\[ERROR\] InnoDB: File .*ibdata1: 'open' returned OS error 71
126126

127127
--echo # 7. With ibdata files & Without undo002
128128
--remove_file $bugdir/data/undo002
129-
--error 3
129+
--error 1
130130
--exec $MYSQLD $args
131-
let SEARCH_PATTERN=Expected to open 3 undo tablespaces but was able;
132-
--source include/search_pattern_in_file.inc
133-
let SEARCH_PATTERN=to find only 1 undo tablespaces;
131+
let SEARCH_PATTERN=Unable to open undo tablespace number 2;
134132
--source include/search_pattern_in_file.inc
135133
# clean up & Restore
136134
--source ../include/bootstrap_cleanup.inc
137135

138136
--echo # 8. With ibdata files & Without undo001, undo002
139137
--remove_file $bugdir/data/undo001
140138
--remove_file $bugdir/data/undo002
141-
--error 3
139+
--error 1
142140
--exec $MYSQLD $args
143-
let SEARCH_PATTERN=Expected to open 3 undo tablespaces but was able;
144-
--source include/search_pattern_in_file.inc
145-
let SEARCH_PATTERN=to find only 0 undo tablespaces;
141+
let SEARCH_PATTERN=Unable to open undo tablespace number 1;
146142
--source include/search_pattern_in_file.inc
147143

148144
# clean up & Restore

‎mysql-test/suite/innodb_undo/r/truncate_recover.result

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ set global innodb_fast_shutdown=0;
6262
Pattern "ib_undo_trunc_before_ddl_log_end" found
6363
# restart
6464
drop table t1;
65-
call mtr.add_suppression("Header page consists of zero bytes.*undo00[12]");
66-
call mtr.add_suppression("Datafile.*undo00[12]' is corrupted");
6765
create table t1
6866
(keyc int, c1 char(100), c2 char(100),
6967
primary key(keyc)) engine = innodb;

0 commit comments

Comments
 (0)
Please sign in to comment.