diff options
author | Nirbhay Choubey <nirbhay@skysql.com> | 2014-03-26 15:17:51 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@skysql.com> | 2014-03-26 15:17:51 -0400 |
commit | 09e3094945694277a550cccc8bd1fd11338474b1 (patch) | |
tree | 9ce09379a64d7d2ca4486beb89346eb99c3da6d0 /storage/xtradb/trx | |
parent | c509f48b8e9cd0714154722aee2c9b8e62d1bc94 (diff) | |
parent | 71dafbf9c2cae382c5174bd3ce73472b97013d62 (diff) | |
download | mariadb-git-09e3094945694277a550cccc8bd1fd11338474b1.tar.gz |
Merging wsrep specific changes from InnoDB to
xtradb (r3683..3808).
Diffstat (limited to 'storage/xtradb/trx')
-rw-r--r-- | storage/xtradb/trx/trx0sys.cc | 46 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0trx.cc | 2 |
2 files changed, 43 insertions, 5 deletions
diff --git a/storage/xtradb/trx/trx0sys.cc b/storage/xtradb/trx/trx0sys.cc index bc61691a684..ed3d177820f 100644 --- a/storage/xtradb/trx/trx0sys.cc +++ b/storage/xtradb/trx/trx0sys.cc @@ -213,7 +213,8 @@ trx_sys_update_mysql_binlog_offset( { #ifndef WITH_WSREP trx_sysf_t* sys_header; -#endif +#endif /* !WITH_WSREP */ + if (ut_strlen(file_name) >= TRX_SYS_MYSQL_LOG_NAME_LEN) { /* We cannot fit the name to the 512 bytes we have reserved */ @@ -223,7 +224,7 @@ trx_sys_update_mysql_binlog_offset( #ifndef WITH_WSREP sys_header = trx_sysf_get(mtr); -#endif +#endif /* !WITH_WSREP */ if (mach_read_from_4(sys_header + field + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) @@ -312,12 +313,49 @@ trx_sys_print_mysql_binlog_offset(void) #ifdef WITH_WSREP +#ifdef UNIV_DEBUG +static long long trx_sys_cur_xid_seqno = -1; +static unsigned char trx_sys_cur_xid_uuid[16]; + +long long read_wsrep_xid_seqno(const XID* xid) +{ + long long seqno; + memcpy(&seqno, xid->data + 24, sizeof(long long)); + return seqno; +} + +void read_wsrep_xid_uuid(const XID* xid, unsigned char* buf) +{ + memcpy(buf, xid->data + 8, 16); +} + +#endif /* UNIV_DEBUG */ + void trx_sys_update_wsrep_checkpoint( - const XID* xid, /*!< in: transaction XID */ + const XID* xid, /*!< in: transaction XID */ trx_sysf_t* sys_header, /*!< in: sys_header */ - mtr_t* mtr) /*!< in: mtr */ + mtr_t* mtr) /*!< in: mtr */ { +#ifdef UNIV_DEBUG + { + /* Check that seqno is monotonically increasing */ + unsigned char xid_uuid[16]; + long long xid_seqno = read_wsrep_xid_seqno(xid); + read_wsrep_xid_uuid(xid, xid_uuid); + if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 8)) + { + ut_ad(xid_seqno > trx_sys_cur_xid_seqno); + trx_sys_cur_xid_seqno = xid_seqno; + } + else + { + memcpy(trx_sys_cur_xid_uuid, xid_uuid, 16); + } + trx_sys_cur_xid_seqno = xid_seqno; + } +#endif /* UNIV_DEBUG */ + ut_ad(xid && mtr); ut_a(xid->formatID == -1 || wsrep_is_wsrep_xid((const void *)xid)); diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 0279b38446a..04423ea3662 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -1228,7 +1228,7 @@ trx_write_serialisation_history( trx_sys_update_mysql_binlog_offset( trx->mysql_log_file_name, trx->mysql_log_offset, - TRX_SYS_MYSQL_LOG_INFO, + TRX_SYS_MYSQL_LOG_INFO, #ifdef WITH_WSREP sys_header, #endif /* WITH_WSREP */ |