Comments about stabilize operation, track unsynced_writes correctly

This commit is contained in:
Vitaliy Filippov
2019-11-11 02:53:19 +03:00
parent 8edb9e9d6f
commit d2d8d6e7fb
4 changed files with 69 additions and 40 deletions
+9 -16
View File
@@ -66,6 +66,11 @@ int blockstore::dequeue_write(blockstore_operation *op)
);
op->pending_ops = 1;
op->min_used_journal_sector = op->max_used_journal_sector = 0;
// Remember write as unsynced
unsynced_big_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
else
{
@@ -111,6 +116,10 @@ int blockstore::dequeue_write(blockstore_operation *op)
dirty_it->second.state = ST_J_SUBMITTED;
journal.next_free += op->len;
op->pending_ops = 2;
unsynced_small_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
return 1;
}
@@ -155,21 +164,5 @@ void blockstore::handle_write_event(ring_data_t *data, blockstore_operation *op)
// Acknowledge write without sync
op->retval = op->len;
op->callback(op);
// Remember write as unsynced
// FIXME: Could state change to ST_STABLE? It could break this check
if (IS_BIG_WRITE(dirty_entry.state))
{
unsynced_big_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
else
{
unsynced_small_writes.push_back((obj_ver_id){
.oid = op->oid,
.version = op->version,
});
}
}
}