summaryrefslogtreecommitdiff
path: root/innobase/include/trx0sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/include/trx0sys.h')
-rw-r--r--innobase/include/trx0sys.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h
index a54a6424a4f..0005c4a1711 100644
--- a/innobase/include/trx0sys.h
+++ b/innobase/include/trx0sys.h
@@ -37,21 +37,35 @@ extern trx_sys_t* trx_sys;
/* Doublewrite system */
extern trx_doublewrite_t* trx_doublewrite;
+extern ibool trx_doublewrite_must_reset_space_ids;
+extern ibool trx_sys_multiple_tablespace_format;
/********************************************************************
-Creates the doublewrite buffer at a database start. The header of the
+Creates the doublewrite buffer to a new InnoDB installation. The header of the
doublewrite buffer is placed on the trx system header page. */
void
trx_sys_create_doublewrite_buf(void);
/*================================*/
/********************************************************************
-At a database startup uses a possible doublewrite buffer to restore
+At a database startup initializes the doublewrite buffer memory structure if
+we already have a doublewrite buffer created in the data files. If we are
+upgrading to an InnoDB version which supports multiple tablespaces, then this
+function performs the necessary update operations. If we are in a crash
+recovery, this function uses a possible doublewrite buffer to restore
half-written pages in the data files. */
void
-trx_sys_doublewrite_restore_corrupt_pages(void);
-/*===========================================*/
+trx_sys_doublewrite_init_or_restore_pages(
+/*======================================*/
+ ibool restore_corrupt_pages);
+/********************************************************************
+Marks the trx sys header when we have successfully upgraded to the >= 4.1.x
+multiple tablespace format. */
+
+void
+trx_sys_mark_upgraded_to_multiple_tablespaces(void);
+/*===============================================*/
/********************************************************************
Determines if a page number is located inside the doublewrite buffer. */
@@ -354,8 +368,17 @@ this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
sys header is half-written
to disk, we still may be able
to recover the information */
+#define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED (24 + FSEG_HEADER_SIZE)
+ /* If this is not yet set to
+ .._N, we must reset the
+ doublewrite buffer, because
+ starting from 4.1.x the space
+ id of a data page is stored to
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO */
/*-------------------------------------------------------------*/
#define TRX_SYS_DOUBLEWRITE_MAGIC_N 536853855
+#define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 1783657386
+
#define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE