Move ack_sync() near sync_state = SYNC_DONE so it does not hang with disable_journal_fsync

blocking-uring-test
Vitaliy Filippov 2020-01-29 16:50:35 +03:00
parent 1e286eed08
commit f4707709c6
1 changed files with 4 additions and 5 deletions

View File

@ -16,6 +16,8 @@ int blockstore_impl_t::dequeue_sync(blockstore_op_t *op)
stop_sync_submitted = false; stop_sync_submitted = false;
PRIV(op)->sync_big_writes.swap(unsynced_big_writes); PRIV(op)->sync_big_writes.swap(unsynced_big_writes);
PRIV(op)->sync_small_writes.swap(unsynced_small_writes); PRIV(op)->sync_small_writes.swap(unsynced_small_writes);
PRIV(op)->sync_small_checked = 0;
PRIV(op)->sync_big_checked = 0;
unsynced_big_writes.clear(); unsynced_big_writes.clear();
unsynced_small_writes.clear(); unsynced_small_writes.clear();
if (PRIV(op)->sync_big_writes.size() > 0) if (PRIV(op)->sync_big_writes.size() > 0)
@ -28,11 +30,7 @@ int blockstore_impl_t::dequeue_sync(blockstore_op_t *op)
PRIV(op)->prev_sync_count = in_progress_syncs.size(); PRIV(op)->prev_sync_count = in_progress_syncs.size();
PRIV(op)->in_progress_ptr = in_progress_syncs.insert(in_progress_syncs.end(), op); PRIV(op)->in_progress_ptr = in_progress_syncs.insert(in_progress_syncs.end(), op);
} }
int r = continue_sync(op); continue_sync(op);
if (r)
{
ack_sync(op);
}
// Always dequeue because we always add syncs to in_progress_syncs // Always dequeue because we always add syncs to in_progress_syncs
return 1; return 1;
} }
@ -173,6 +171,7 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
else else
{ {
PRIV(op)->sync_state = SYNC_DONE; PRIV(op)->sync_state = SYNC_DONE;
ack_sync(op);
} }
} }
return 1; return 1;