Read stats for backlog verifies not reported for time-expired workloads
authorHorshack <horshack@live.com>
Fri, 10 Feb 2023 02:47:38 +0000 (21:47 -0500)
committerHorshack <horshack@live.com>
Tue, 14 Feb 2023 14:36:29 +0000 (09:36 -0500)
When verify_backlog is used on a write-only workload with a runtime= value
and the runtime expires before the workload has written its full dataset,
the read stats for the backlog verifies are not reported, resulting in a
stat result showing only the workload writes (ie, the "read:" results
section is completely missing from fio's stats output)

The logic in thread_main() fails to call update_runtime() for DDIR_READ
because the existing call to update_runtime() for DDIR_READ on write-only
workloads is currently only done after do_verify() is complete, which wont
be called in this scenario because td->terminate is true due to the
expiration of the runtime.

Link: https://github.com/axboe/fio/issues/1515
Signed-off-by: Adam Horshack (horshack@live.com)
backend.c

index 928e524a370c21abb0a6cf1a232e29525a55185b..c6b97dd9c802ed7ab80439dbbfe2f7eefca3a102 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1919,7 +1919,8 @@ static void *thread_main(void *data)
                        }
                } while (1);
 
-               if (td_read(td) && td->io_bytes[DDIR_READ])
+               if (td->io_bytes[DDIR_READ] && (td_read(td) ||
+                       ((td->flags & TD_F_VER_BACKLOG) && td_write(td))))
                        update_runtime(td, elapsed_us, DDIR_READ);
                if (td_write(td) && td->io_bytes[DDIR_WRITE])
                        update_runtime(td, elapsed_us, DDIR_WRITE);