Fix sync confirmations and some pipeline-stall bugs

This commit is contained in:
Vitaliy Filippov
2019-11-27 18:07:38 +03:00
parent 78807eb244
commit e2b91968c5
7 changed files with 72 additions and 49 deletions
+10 -18
View File
@@ -41,24 +41,6 @@ void blockstore::enqueue_write(blockstore_operation *op)
.len = op->len,
.journal_sector = 0,
});
// Remember write as unsynced here, so external consumers could get
// the list of dirty objects to sync just before issuing a SYNC request
if (op->len == block_size || op->version == 1)
{
// Remember big write as unsynced
unsynced_big_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
else
{
// Remember small write as unsynced
unsynced_small_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
}
// First step of the write algorithm: dequeue operation and submit initial write(s)
@@ -109,6 +91,11 @@ int blockstore::dequeue_write(blockstore_operation *op)
);
op->pending_ops = 1;
op->min_used_journal_sector = op->max_used_journal_sector = 0;
// Remember big write as unsynced
unsynced_big_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
else
{
@@ -154,6 +141,11 @@ int blockstore::dequeue_write(blockstore_operation *op)
dirty_it->second.state = ST_J_SUBMITTED;
journal.next_free += op->len;
op->pending_ops = 2;
// Remember small write as unsynced
unsynced_small_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
return 1;
}