Commit 04074c9f authored by Yoni Fogel's avatar Yoni Fogel

[t:2216] Bugfix with load:

If a transaction does a load(oldname,newname), and commits, the xcommit log entry MUST
be fsynced, even if the user said we can turn off fsyncs.

This is similar to an fdelete done by a transaction.

git-svn-id: file:///svn/toku/tokudb@18789 c7de825b-a66e-492c-adef-691d508d4ae1
parent c41a6dfd
......@@ -2661,12 +2661,15 @@ int
toku_brt_load_recovery(TOKUTXN txn, char const * old_iname, char const * new_iname, int do_fsync, int do_log) {
int r = 0;
assert(txn);
toku_txn_force_fsync_on_commit(txn); //If the txn commits, the commit MUST be in the log
//before the (old) file is actually unlinked
TOKULOGGER logger = toku_txn_logger(txn);
BYTESTRING old_iname_bs = {.len=strlen(old_iname),
.data=toku_memdup_in_rollback(txn, old_iname, strlen(old_iname))};
BYTESTRING new_iname_bs = {.len=strlen(new_iname),
.data=toku_memdup_in_rollback(txn, new_iname, strlen(new_iname))};
r = toku_logger_save_rollback_load(txn, old_iname_bs, new_iname_bs);
if (r==0 && do_log && logger) {
TXNID xid = toku_txn_get_txnid(txn);
......
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