Skip to content

Commit

Permalink
Extend trx_sys library
Browse files Browse the repository at this point in the history
  • Loading branch information
romz-pl committed Sep 6, 2019
1 parent 45db0d4 commit 657bf44
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 19 deletions.
Binary file modified library-dependency/innobase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 1 addition & 14 deletions storage/innobase/include/trx0sys.ic
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
/* The typedef for rseg slot in the file copy */
typedef byte trx_sysf_rseg_t;

/* Rollback segment specification slot offsets */
/*-------------------------------------------------------------*/
#define TRX_SYS_RSEG_SPACE \
0 /* space where the segment \
header is placed; starting with \
MySQL/InnoDB 5.1.7, this is \
UNIV_UNDEFINED if the slot is unused */
#define TRX_SYS_RSEG_PAGE_NO \
4 /* page number where the segment \
header is placed; this is FIL_NULL \
if the slot is unused */
/*-------------------------------------------------------------*/
/* Size of a rollback segment specification slot */
#define TRX_SYS_RSEG_SLOT_SIZE 8


/** Writes the value of max_trx_id to the file based trx system header. */
void trx_sys_flush_max_trx_id(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <innodb/dict_mem/dict_sdi_get_table_id.h>
#include <innodb/dict_mem/flags.h>
#include <innodb/trx_sys/flags.h>

/** Check if an table id belongs SDI table
@param[in] table_id dict_table_t id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,7 @@ a foreign key constraint is enforced, therefore RESTRICT just means no flag */
/** SDI version. Written on Page 1 & 2 at FIL_PAGE_FILE_FLUSH_LSN offset. */
const uint32_t SDI_VERSION = 1;

/** Space id of the transaction system page (the system tablespace) */
static const space_id_t TRX_SYS_SPACE = 0;

/** Space id of system tablespace */
const space_id_t SYSTEM_TABLE_SPACE = TRX_SYS_SPACE;

/** Identifies generated InnoDB foreign key names */
static char dict_ibfk[] = "_ibfk_";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <innodb/dict_mem/flags.h>
#include <innodb/mtr/mlog_write_initial_log_record_low.h>
#include <innodb/mtr/mtr_t.h>

#include <innodb/trx_sys/flags.h>

/** Set to TRUE when the doublewrite buffer is being created */
extern ibool buf_dblwr_being_created;
Expand Down
1 change: 1 addition & 0 deletions storage/innobase/libs/tablespace/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ target_link_libraries(
log_types
page
string
trx_sys
trx_types
PRIVATE
)
Expand Down
1 change: 1 addition & 0 deletions storage/innobase/libs/tablespace/src/Fil_shard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include <innodb/tablespace/fil_system.h>
#include <innodb/enum/to_int.h>
#include <innodb/tablespace/dict_sys_t_is_reserved.h>
#include <innodb/trx_sys/flags.h>

#include <atomic>

Expand Down
1 change: 1 addition & 0 deletions storage/innobase/libs/tablespace/src/SysTablespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <innodb/tablespace/fil_type_t.h>
#include <innodb/tablespace/fil_space_t.h>
#include <innodb/dict_mem/flags.h>
#include <innodb/trx_sys/flags.h>

#include "sql/mysqld.h"

Expand Down
1 change: 1 addition & 0 deletions storage/innobase/libs/tablespace/src/Tablespace_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <innodb/tablespace/consts.h>
#include <innodb/tablespace/dict_sys_t_is_reserved.h>
#include <innodb/logger/warn.h>
#include <innodb/trx_sys/flags.h>

/** Constructor
@param[in] dir Directory that the files are under */
Expand Down
1 change: 1 addition & 0 deletions storage/innobase/libs/tablespace/src/fil_space_create.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <innodb/tablespace/fil_space_create.h>

#include <innodb/tablespace/fil_system.h>
#include <innodb/trx_sys/flags.h>

bool clone_mark_abort(bool force);
void clone_mark_active();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <innodb/tablespace/fil_system.h>
#include <innodb/string/mem_strdup.h>
#include <innodb/trx_sys/flags.h>

/** Returns the path from the first fil_node_t found with this space ID.
The caller is responsible for freeing the memory allocated here for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <innodb/tablespace/fil_read.h>
#include <innodb/tablespace/fil_write.h>
#include <innodb/machine/data.h>
#include <innodb/trx_sys/flags.h>

/** Write the flushed LSN to the page header of the first page in the
system tablespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <innodb/tablespace/fsp_is_undo_tablespace.h>
#include <innodb/tablespace/fsp_is_system_temporary.h>
#include <innodb/tablespace/consts.h>
#include <innodb/trx_sys/flags.h>

/** Determine if the space ID is an IBD tablespace, either file_per_table
or a general shared tablespace, where user tables exist.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <innodb/tablespace/fsp_is_system_tablespace.h>

#include <innodb/tablespace/consts.h>
#include <innodb/trx_sys/flags.h>

bool fsp_is_system_tablespace(space_id_t space_id) {
return (space_id == TRX_SYS_SPACE);
Expand Down
27 changes: 27 additions & 0 deletions storage/innobase/libs/trx_sys/include/innodb/trx_sys/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,30 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID. */
two) is assigned, the field TRX_SYS_TRX_ID_STORE on the transaction system
page is updated */
#define TRX_SYS_TRX_ID_WRITE_MARGIN ((trx_id_t)256)





/* Rollback segment specification slot offsets */
/*-------------------------------------------------------------*/
#define TRX_SYS_RSEG_SPACE \
0 /* space where the segment \
header is placed; starting with \
MySQL/InnoDB 5.1.7, this is \
UNIV_UNDEFINED if the slot is unused */
#define TRX_SYS_RSEG_PAGE_NO \
4 /* page number where the segment \
header is placed; this is FIL_NULL \
if the slot is unused */
/*-------------------------------------------------------------*/
/* Size of a rollback segment specification slot */
#define TRX_SYS_RSEG_SLOT_SIZE 8



/** Space id of the transaction system page (the system tablespace) */
static const space_id_t TRX_SYS_SPACE = 0;

/** Space id of system tablespace */
const space_id_t SYSTEM_TABLE_SPACE = TRX_SYS_SPACE;

0 comments on commit 657bf44

Please sign in to comment.