Wait for free space again, but count on big_write flushes instead of just flusher activity

This commit is contained in:
Vitaliy Filippov
2023-05-10 01:51:02 +03:00
parent f4c6765522
commit a409598b16
5 changed files with 29 additions and 0 deletions
+12
View File
@@ -307,6 +307,18 @@ void blockstore_impl_t::check_wait(blockstore_op_t *op)
}
PRIV(op)->wait_for = 0;
}
else if (PRIV(op)->wait_for == WAIT_FREE)
{
if (!data_alloc->get_free_count() && big_to_flush > 0)
{
#ifdef BLOCKSTORE_DEBUG
printf("Still waiting for free space on the data device\n");
#endif
return;
}
flusher->release_trim();
PRIV(op)->wait_for = 0;
}
else
{
throw std::runtime_error("BUG: op->wait_for value is unexpected");