Commit 752aaebe authored by Sergey Vojtovich's avatar Sergey Vojtovich

Applying InnoDB snapshot

Detailed revision comments:

r6611 | marko | 2010-02-09 14:28:25 +0200 (Tue, 09 Feb 2010) | 11 lines
branches/zip: Roll back dictionary transaction(s) before scanning *.ibd files

innobase_start_or_create_for_mysql(): Roll back data dictionary
transactions before scanning the *.ibd files. Then, data dictionary
records can be loaded to the cache before opening the *.ibd files.

recv_recovery_rollback_active(): Refactored from
recv_recovery_from_checkpoint_finish().

rb://235, committing without review, because this is needed for
TablespaceDictionary.
parent cb10d756
...@@ -176,6 +176,12 @@ UNIV_INTERN ...@@ -176,6 +176,12 @@ UNIV_INTERN
void void
recv_recovery_from_checkpoint_finish(void); recv_recovery_from_checkpoint_finish(void);
/*======================================*/ /*======================================*/
/********************************************************//**
Initiates the rollback of active transactions. */
UNIV_INTERN
void
recv_recovery_rollback_active(void);
/*===============================*/
/*******************************************************//** /*******************************************************//**
Scans log from a buffer and stores new log data to the parsing buffer. Scans log from a buffer and stores new log data to the parsing buffer.
Parses and hashes the log records if new data found. Unless Parses and hashes the log records if new data found. Unless
......
...@@ -3212,8 +3212,6 @@ void ...@@ -3212,8 +3212,6 @@ void
recv_recovery_from_checkpoint_finish(void) recv_recovery_from_checkpoint_finish(void)
/*======================================*/ /*======================================*/
{ {
int i;
/* Apply the hashed log records to the respective file pages */ /* Apply the hashed log records to the respective file pages */
if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
...@@ -3261,6 +3259,16 @@ recv_recovery_from_checkpoint_finish(void) ...@@ -3261,6 +3259,16 @@ recv_recovery_from_checkpoint_finish(void)
The data dictionary latch should guarantee that there is at The data dictionary latch should guarantee that there is at
most one data dictionary transaction active at a time. */ most one data dictionary transaction active at a time. */
trx_rollback_or_clean_recovered(FALSE); trx_rollback_or_clean_recovered(FALSE);
}
/********************************************************//**
Initiates the rollback of active transactions. */
UNIV_INTERN
void
recv_recovery_rollback_active(void)
/*===============================*/
{
int i;
/* Drop partially created indexes. */ /* Drop partially created indexes. */
row_merge_drop_temp_indexes(); row_merge_drop_temp_indexes();
......
...@@ -1570,6 +1570,14 @@ innobase_start_or_create_for_mysql(void) ...@@ -1570,6 +1570,14 @@ innobase_start_or_create_for_mysql(void)
dict_boot(); dict_boot();
trx_sys_init_at_db_start(); trx_sys_init_at_db_start();
/* Initialize the fsp free limit global variable in the log
system */
fsp_header_get_free_limit();
/* recv_recovery_from_checkpoint_finish needs trx lists which
are initialized in trx_sys_init_at_db_start(). */
recv_recovery_from_checkpoint_finish();
if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
/* The following call is necessary for the insert /* The following call is necessary for the insert
buffer to work with multiple tablespaces. We must buffer to work with multiple tablespaces. We must
...@@ -1585,26 +1593,14 @@ innobase_start_or_create_for_mysql(void) ...@@ -1585,26 +1593,14 @@ innobase_start_or_create_for_mysql(void)
every table in the InnoDB data dictionary that has every table in the InnoDB data dictionary that has
an .ibd file. an .ibd file.
We also determine the maximum tablespace id used. We also determine the maximum tablespace id used. */
TODO: We may have incomplete transactions in the
data dictionary tables. Does that harm the scanning of
the data dictionary below? */
dict_check_tablespaces_and_store_max_id( dict_check_tablespaces_and_store_max_id(
recv_needed_recovery); recv_needed_recovery);
} }
srv_startup_is_before_trx_rollback_phase = FALSE; srv_startup_is_before_trx_rollback_phase = FALSE;
recv_recovery_rollback_active();
/* Initialize the fsp free limit global variable in the log
system */
fsp_header_get_free_limit();
/* recv_recovery_from_checkpoint_finish needs trx lists which
are initialized in trx_sys_init_at_db_start(). */
recv_recovery_from_checkpoint_finish();
/* It is possible that file_format tag has never /* It is possible that file_format tag has never
been set. In this case we initialize it to minimum been set. In this case we initialize it to minimum
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment