From b29f26d774033d9dda6c1a519657f1092c964f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 31 Aug 2017 08:27:59 +0300 Subject: [PATCH] Fix test failures on embedded server. Problem was incorrect definition of wsrep_recovery, trx_sys_update_wsrep_checkpoint and trx_sys_read_wsrep_checkpoint functions causing innodb_plugin not to load as there was undefined symbols. --- storage/innobase/buf/buf0dump.cc | 10 +++++----- storage/innobase/include/trx0sys.h | 7 +++++-- storage/innobase/srv/srv0start.cc | 5 +++-- storage/innobase/trx/trx0sys.cc | 12 ++++++++---- storage/xtradb/buf/buf0dump.cc | 4 +--- storage/xtradb/include/trx0sys.h | 5 ++++- storage/xtradb/srv/srv0start.cc | 3 +-- storage/xtradb/trx/trx0sys.cc | 4 +++- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index 33a39aaed8a..703c425e127 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -41,9 +41,7 @@ Created April 08, 2011 Vasil Dimov #include "sync0rw.h" /* rw_lock_s_lock() */ #include "ut0byte.h" /* ut_ull_create() */ #include "ut0sort.h" /* UT_SORT_FUNCTION_BODY */ -#ifdef WITH_WSREP -extern my_bool wsrep_recovery; -#endif /* WITH_WSREP */ +#include "mysql/service_wsrep.h" /* wsrep_recovery */ enum status_severity { STATUS_INFO, @@ -695,12 +693,13 @@ DECLARE_THREAD(buf_dump_thread)(void*) buf_load_status(STATUS_INFO, "Loading buffer pool(s) not yet started"); if (srv_buffer_pool_load_at_startup) { + #ifdef WITH_WSREP if (!wsrep_recovery) { #endif /* WITH_WSREP */ - buf_load(); + buf_load(); #ifdef WITH_WSREP - } + } #endif /* WITH_WSREP */ } @@ -728,6 +727,7 @@ DECLARE_THREAD(buf_dump_thread)(void*) #ifdef WITH_WSREP if (!wsrep_recovery) { #endif /* WITH_WSREP */ + buf_dump(FALSE /* ignore shutdown down flag, keep going even if we are in a shutdown state */); #ifdef WITH_WSREP diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 83814d088f3..f70c53b57e6 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -315,6 +315,7 @@ trx_sys_print_mysql_binlog_offset(void); @param[in] xid Transaction XID @param[in,out] sys_header sys_header @param[in] mtr minitransaction */ +UNIV_INTERN void trx_sys_update_wsrep_checkpoint( const XID* xid, @@ -322,8 +323,10 @@ trx_sys_update_wsrep_checkpoint( mtr_t* mtr); /** Read WSREP XID from sys_header of TRX_SYS_PAGE_NO = 5. -@param[out] xid Transaction XID */ -void +@param[out] xid Transaction XID +@return true on success, false on error. */ +UNIV_INTERN +bool trx_sys_read_wsrep_checkpoint(XID* xid); #endif /* WITH_WSREP */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 8b963fc3259..0010ec9c002 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -70,8 +70,7 @@ Created 2/16/1996 Heikki Tuuri #include "srv0start.h" #include "srv0srv.h" #include "btr0defragment.h" - -#include +#include "mysql/service_wsrep.h" /* wsrep_recovery */ #ifndef UNIV_HOTBACKUP # include "trx0rseg.h" @@ -3014,6 +3013,7 @@ files_checked: */ if (!wsrep_recovery) { #endif /* WITH_WSREP */ + /* Create the buffer pool dump/load thread */ srv_buf_dump_thread_active = true; buf_dump_thread_handle= @@ -3027,6 +3027,7 @@ files_checked: "wsrep recovery."); } #endif /* WITH_WSREP */ + /* Create thread(s) that handles key rotation */ fil_system_enter(); fil_crypt_threads_init(); diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 8cb4f9a4135..e9443e93140 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -344,6 +344,7 @@ static inline void read_wsrep_xid_uuid(const XID* xid, unsigned char* buf) @param[in] xid Transaction XID @param[in,out] sys_header sys_header @param[in] mtr minitransaction */ +UNIV_INTERN void trx_sys_update_wsrep_checkpoint( const XID* xid, @@ -402,8 +403,10 @@ trx_sys_update_wsrep_checkpoint( } /** Read WSREP XID from sys_header of TRX_SYS_PAGE_NO = 5. -@param[out] xid Transaction XID */ -void +@param[out] xid Transaction XID +@return true on success, false on error. */ +UNIV_INTERN +bool trx_sys_read_wsrep_checkpoint(XID* xid) { trx_sysf_t* sys_header; @@ -423,8 +426,8 @@ trx_sys_read_wsrep_checkpoint(XID* xid) xid->formatID = -1; trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr); mtr_commit(&mtr); - return; - } + return false; + } xid->formatID = (int)mach_read_from_4( sys_header @@ -440,6 +443,7 @@ trx_sys_read_wsrep_checkpoint(XID* xid) XIDDATASIZE); mtr_commit(&mtr); + return true; } #endif /* WITH_WSREP */ diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc index 023a267ee22..bf384390a98 100644 --- a/storage/xtradb/buf/buf0dump.cc +++ b/storage/xtradb/buf/buf0dump.cc @@ -41,9 +41,7 @@ Created April 08, 2011 Vasil Dimov #include "sync0rw.h" /* rw_lock_s_lock() */ #include "ut0byte.h" /* ut_ull_create() */ #include "ut0sort.h" /* UT_SORT_FUNCTION_BODY */ -#ifdef WITH_WSREP -extern my_bool wsrep_recovery; -#endif /* WITH_WSREP */ +#include "mysql/service_wsrep.h" /* wsrep_recovery */ enum status_severity { STATUS_INFO, diff --git a/storage/xtradb/include/trx0sys.h b/storage/xtradb/include/trx0sys.h index 1b418dfe380..85c454c4cf9 100644 --- a/storage/xtradb/include/trx0sys.h +++ b/storage/xtradb/include/trx0sys.h @@ -336,14 +336,17 @@ trx_sys_print_mysql_binlog_offset(void); @param[in] xid Transaction XID @param[in,out] sys_header sys_header @param[in] mtr minitransaction */ +UNIV_INTERN void trx_sys_update_wsrep_checkpoint( const XID* xid, trx_sysf_t* sys_header, mtr_t* mtr); -/** Read WSREP checkpoint XID from sys header. +/** Read WSREP checkpoint XID from sys header. +@param[out] xid Transaction XID @return true on success, false on error. */ +UNIV_INTERN bool trx_sys_read_wsrep_checkpoint( XID* xid); /*!< out: WSREP XID */ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index bd31f229dc0..c87b7652c21 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -73,8 +73,7 @@ Created 2/16/1996 Heikki Tuuri #include "btr0defragment.h" #include "ut0timer.h" #include "btr0scrub.h" - -#include +#include "mysql/service_wsrep.h" /* wsrep_recovery */ #ifndef UNIV_HOTBACKUP # include "trx0rseg.h" diff --git a/storage/xtradb/trx/trx0sys.cc b/storage/xtradb/trx/trx0sys.cc index 063a43b177c..d2b1a8f9f0d 100644 --- a/storage/xtradb/trx/trx0sys.cc +++ b/storage/xtradb/trx/trx0sys.cc @@ -348,6 +348,7 @@ static inline void read_wsrep_xid_uuid(const XID* xid, unsigned char* buf) @param[in] xid Transaction XID @param[in,out] sys_header sys_header @param[in] mtr minitransaction */ +UNIV_INTERN void trx_sys_update_wsrep_checkpoint( const XID* xid, @@ -406,8 +407,9 @@ trx_sys_update_wsrep_checkpoint( } /** Read WSREP XID from sys_header of TRX_SYS_PAGE_NO = 5. -@param[out] xid Transaction XID +@param[out] xid Transaction XID @retval true if found, false if not */ +UNIV_INTERN bool trx_sys_read_wsrep_checkpoint(XID* xid) {