summaryrefslogtreecommitdiff
path: root/storage/tokudb/ft-index/src/ydb_txn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/ft-index/src/ydb_txn.cc')
-rw-r--r--storage/tokudb/ft-index/src/ydb_txn.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/storage/tokudb/ft-index/src/ydb_txn.cc b/storage/tokudb/ft-index/src/ydb_txn.cc
index ce06e78b23f..885c6b713b2 100644
--- a/storage/tokudb/ft-index/src/ydb_txn.cc
+++ b/storage/tokudb/ft-index/src/ydb_txn.cc
@@ -240,7 +240,7 @@ static int toku_txn_abort(DB_TXN * txn,
return r;
}
-static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) {
+static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid, uint32_t flags) {
int r = 0;
if (!txn) {
r = EINVAL;
@@ -273,9 +273,11 @@ static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) {
HANDLE_PANICKED_ENV(txn->mgrp);
}
assert(!db_txn_struct_i(txn)->child);
+ int nosync;
+ nosync = (flags & DB_TXN_NOSYNC)!=0 || (db_txn_struct_i(txn)->flags&DB_TXN_NOSYNC);
TOKUTXN ttxn;
ttxn = db_txn_struct_i(txn)->tokutxn;
- toku_txn_prepare_txn(ttxn, xid);
+ toku_txn_prepare_txn(ttxn, xid, nosync);
TOKULOGGER logger;
logger = txn->mgrp->i->logger;
LSN do_fsync_lsn;
@@ -292,14 +294,14 @@ exit:
// requires: must hold the multi operation lock. it is
// released in toku_txn_xa_prepare before the fsync.
-static int toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE]) {
+static int toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE], uint32_t flags) {
TOKU_XA_XID xid;
TOKU_ANNOTATE_NEW_MEMORY(&xid, sizeof(xid));
xid.formatID=0x756b6f54; // "Toku"
xid.gtrid_length=DB_GID_SIZE/2; // The maximum allowed gtrid length is 64. See the XA spec in source:/import/opengroup.org/C193.pdf page 20.
xid.bqual_length=DB_GID_SIZE/2; // The maximum allowed bqual length is 64.
memcpy(xid.data, gid, DB_GID_SIZE);
- return toku_txn_xa_prepare(txn, &xid);
+ return toku_txn_xa_prepare(txn, &xid, flags);
}
static int toku_txn_txn_stat (DB_TXN *txn, struct txn_stat **txn_stat) {
@@ -427,6 +429,15 @@ static bool toku_txn_is_prepared(DB_TXN *txn) {
return toku_txn_get_state(ttxn) == TOKUTXN_PREPARING;
}
+static DB_TXN *toku_txn_get_child(DB_TXN *txn) {
+ return db_txn_struct_i(txn)->child;
+}
+
+static uint64_t toku_txn_get_start_time(DB_TXN *txn) {
+ TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
+ return toku_txn_get_start_time(ttxn);
+}
+
static inline void txn_func_init(DB_TXN *txn) {
#define STXN(name) txn->name = locked_txn_ ## name
STXN(abort);
@@ -444,6 +455,8 @@ static inline void txn_func_init(DB_TXN *txn) {
#undef SUTXN
txn->id64 = toku_txn_id64;
txn->is_prepared = toku_txn_is_prepared;
+ txn->get_child = toku_txn_get_child;
+ txn->get_start_time = toku_txn_get_start_time;
}
//