Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libs/taf_libs/TAF/Run.pm
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,13 @@ sub CheckTestSetup {
if($dbMode eq "restore" && !$restoreCreated){
PrintVerbose("Database restore requested, creating restore image...");
return ERROR if _CreateRestoreImage($ctx) != OK;
# Restore immediately after creating the image so iteration 1 runs
# on the same freshly-restored datadir as every later iteration;
# a natively-filled datadir and a restored copy differ in physical
# state (storage cache warmth, file layout) and skew results.
PrintVerbose("Restoring image so iteration 1 runs on a restored datadir.");
$state->{first_time_in_tests_loop} = FALSE;
return _RestoreImage($ctx);
}
}

Expand Down Expand Up @@ -2628,6 +2635,13 @@ sub _RestoreImage {
return ERROR;
}

#
# Flush the page cache so writeback from the restored datadir completes
# while the database is still stopped; otherwise it competes with the
# test's I/O after startup.
#
system("sync");

#
# Start backend after restore
#
Expand Down