Do not duplicate blockstore operations when io_uring fills up

This bug was leading to OSDs dying with "Assertion `fulfilled == read_op->len' failed"
when testing fio -rw=randread -numjobs=8 -iodepth=128
This commit is contained in:
Vitaliy Filippov
2021-03-16 12:48:26 +03:00
parent 9f59381bea
commit c5fb1d5987
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -105,10 +105,10 @@ void blockstore_impl_t::loop()
// has_writes == 1 - some writes in progress
// has_writes == 2 - tried to submit some writes, but failed
int has_writes = 0, op_idx = 0, new_idx = 0;
for (; op_idx < submit_queue.size(); op_idx++)
for (; op_idx < submit_queue.size(); op_idx++, new_idx++)
{
auto op = submit_queue[op_idx];
submit_queue[new_idx++] = op;
submit_queue[new_idx] = op;
// FIXME: This needs some simplification
// Writes should not block reads if the ring is not full and reads don't depend on them
// In all other cases we should stop submission