Attempt forced trim when stopping an overrun flusher

Fixes a rare hang happening in the event of journal space running out without
new work to do for flushers except the current sector.
The hang could be reproduced more or less consistently with very slow drives.
This commit is contained in:
Vitaliy Filippov
2021-02-24 01:33:01 +03:00
parent 7cc59260c5
commit 2d9f09dcb6
2 changed files with 6 additions and 9 deletions
+2 -3
View File
@@ -223,6 +223,7 @@ bool journal_flusher_co::loop()
resume_0:
if (!flusher->flush_queue.size() || !flusher->dequeuing)
{
stop_flusher:
if (flusher->trim_wanted > 0 && flusher->journal_trim_counter > 0)
{
// Attempt forced trim
@@ -327,9 +328,7 @@ resume_0:
#ifdef BLOCKSTORE_DEBUG
printf("No older flushes, stopping\n");
#endif
flusher->dequeuing = false;
wait_state = 0;
return true;
goto stop_flusher;
}
}
}