Commit 492ee2b9 authored by Yoni Fogel's avatar Yoni Fogel

closes[t:2692] Fix two races that helgrind reports.

Technically neither one causes any problems.

git-svn-id: file:///svn/toku/tokudb@20881 c7de825b-a66e-492c-adef-691d508d4ae1
parent 824e20e7
......@@ -2758,8 +2758,8 @@ int toku_brt_maybe_insert (BRT brt, DBT *key, DBT *val, TOKUTXN txn, BOOL oplsn_
if (r!=0) return r;
}
LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
LSN treelsn;
if (oplsn_valid && oplsn.lsn <= (treelsn = toku_brt_checkpoint_lsn(brt)).lsn) {
r = 0;
} else {
BRT_MSG_S brtcmd = { type, message_xids, .u.id={key,val}};
......@@ -2825,8 +2825,8 @@ int toku_brt_maybe_delete(BRT brt, DBT *key, TOKUTXN txn, BOOL oplsn_valid, LSN
if (r!=0) return r;
}
LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
LSN treelsn;
if (oplsn_valid && oplsn.lsn <= (treelsn = toku_brt_checkpoint_lsn(brt)).lsn) {
r = 0;
} else {
DBT val;
......@@ -5377,8 +5377,8 @@ int toku_brt_maybe_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn, BOOL op
if (r!=0) return r;
}
LSN treelsn = toku_brt_checkpoint_lsn(brt);
if (oplsn_valid && oplsn.lsn <= treelsn.lsn) {
LSN treelsn;
if (oplsn_valid && oplsn.lsn <= (treelsn = toku_brt_checkpoint_lsn(brt)).lsn) {
r = 0;
} else {
BRT_MSG_S brtcmd = { BRT_DELETE_BOTH, message_xids, .u.id={key,val}};
......
......@@ -475,18 +475,13 @@ int toku_logger_fsync (TOKULOGGER logger)
int
toku_logger_fsync_if_lsn_not_fsynced (TOKULOGGER logger, LSN lsn) {
int r = 0;
if (logger->is_panicked) r = EINVAL;
else if (logger->write_log_files && logger->fsynced_lsn.lsn < lsn.lsn) {
r = ml_lock(&logger->input_lock); assert(r==0);
logger->input_lock_ctr++;
r = toku_logger_maybe_fsync(logger, lsn, TRUE);
if (r!=0) {
toku_logger_panic(logger, r);
}
else {
assert(logger->fsynced_lsn.lsn >= lsn.lsn);
}
int r;
if (logger->is_panicked) return EINVAL;
r = ml_lock(&logger->input_lock); assert(r==0);
logger->input_lock_ctr++;
r = toku_logger_maybe_fsync(logger, lsn, TRUE);
if (r!=0) {
toku_logger_panic(logger, r);
}
return r;
}
......
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