Commit 590e4e12 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

imp DB_TXN_SYNC ref[t:2190]

git-svn-id: file:///svn/toku/tokudb@15936 c7de825b-a66e-492c-adef-691d508d4ae1
parent e02f0ee0
......@@ -5222,7 +5222,7 @@ int toku_brt_remove_on_commit(TOKUTXN txn, DBT* iname_dbt_p, DBT* iname_within_c
else
assert(r==ENOENT);
txn->force_fsync_on_commit = 1; //If the txn commits, the commit MUST be in the log
toku_txn_force_fsync_on_commit(txn); //If the txn commits, the commit MUST be in the log
//before the file is actually unlinked
{
const char *iname_within_cwd = iname_within_cwd_dbt_p->data;
......
......@@ -118,8 +118,8 @@ struct tokutxn {
u_int64_t rollentry_raw_count; // the total count of every byte in the transaction and all its children.
OMT open_brts; // a collection of the brts that we touched. Indexed by filenum.
XIDS xids; //Represents the xid list
int force_fsync_on_commit; //This transaction NEEDS an fsync once (if) it commits. (commit means root txn)
int has_done_work; //If this transaction has not done work, there is no need to fsync.
BOOL force_fsync_on_commit; //This transaction NEEDS an fsync once (if) it commits. (commit means root txn)
BOOL has_done_work; //If this transaction has not done work, there is no need to fsync.
};
static inline int toku_logsizeof_u_int8_t (u_int32_t v __attribute__((__unused__))) {
......
......@@ -60,7 +60,7 @@ int toku_txn_begin_with_xid (TOKUTXN parent_tokutxn, TOKUTXN *tokutxn, TOKULOGGE
result->rollentry_filename = 0;
result->rollentry_fd = -1;
result->rollentry_filesize = 0;
result->force_fsync_on_commit = 0;
result->force_fsync_on_commit = FALSE;
result->has_done_work = 0;
*tokutxn = result;
return 0;
......@@ -130,3 +130,7 @@ BOOL toku_txnid_newer(TXNID a, TXNID b) {
BOOL toku_txnid_eq(TXNID a, TXNID b) {
return (BOOL)(a == b);
}
void toku_txn_force_fsync_on_commit(TOKUTXN txn) {
txn->force_fsync_on_commit = TRUE;
}
......@@ -26,4 +26,7 @@ BOOL toku_txnid_eq(TXNID a, TXNID b);
// Returns TRUE if a is newer than b
BOOL toku_txnid_newer(TXNID a, TXNID b);
// Force fsync on commit
void toku_txn_force_fsync_on_commit(TOKUTXN txn);
#endif //TOKUTXN_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment