Browse Source

trx_sys_read_wsrep_checkpoint(): Return whether a checkpoint is present

pull/185/head
Marko Mäkelä 8 years ago
parent
commit
aea0e125d2
  1. 10
      storage/innobase/include/trx0sys.h
  2. 12
      storage/innobase/trx/trx0sys.cc

10
storage/innobase/include/trx0sys.h

@ -255,11 +255,11 @@ trx_sys_update_wsrep_checkpoint(
trx_sysf_t* sys_header, /*!< in: sys_header */
mtr_t* mtr); /*!< in: mtr */
void
/** Read WSREP checkpoint XID from sys header. */
trx_sys_read_wsrep_checkpoint(
/*==========================*/
XID* xid); /*!< out: WSREP XID */
/** Read WSREP checkpoint XID from sys header.
@param[out] xid WSREP XID
@return whether the checkpoint was present */
bool
trx_sys_read_wsrep_checkpoint(XID* xid);
#endif /* WITH_WSREP */
/** Initializes the tablespace tag system. */

12
storage/innobase/trx/trx0sys.cc

@ -349,10 +349,11 @@ trx_sys_update_wsrep_checkpoint(
}
void
trx_sys_read_wsrep_checkpoint(
/*==========================*/
XID* xid)
/** Read WSREP checkpoint XID from sys header.
@param[out] xid WSREP XID
@return whether the checkpoint was present */
bool
trx_sys_read_wsrep_checkpoint(XID* xid)
{
trx_sysf_t* sys_header;
mtr_t mtr;
@ -372,7 +373,7 @@ trx_sys_read_wsrep_checkpoint(
memcpy(xid->data + 24, &seqno, sizeof(long long));
xid->formatID = -1;
mtr_commit(&mtr);
return;
return false;
}
xid->formatID = (int)mach_read_from_4(
@ -389,6 +390,7 @@ trx_sys_read_wsrep_checkpoint(
XIDDATASIZE);
mtr_commit(&mtr);
return true;
}
#endif /* WITH_WSREP */

Loading…
Cancel
Save