Skip to content

Commit

Permalink
rbd: bench should flush prior to starting a test
Browse files Browse the repository at this point in the history
For the new read-based bench tests, flushing prior to the start of the test
will result in the exclusive lock being acquired and the object map being
utilized.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Oct 23, 2017
1 parent a878eca commit f2d1ac2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/tools/rbd/action/Bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ int do_bench(librbd::Image& image, io_type_t io_type,
return -EINVAL;
}

int r = image.flush();
if (r < 0) {
std::cerr << "rbd: failed to flush: " << cpp_strerror(r) << std::endl;
}

rbd_bencher b(&image, io_type, io_size);

std::cout << "bench "
Expand Down Expand Up @@ -316,9 +321,9 @@ int do_bench(librbd::Image& image, io_type_t io_type,
}
}
b.wait_for(0);
int r = image.flush();
r = image.flush();
if (r < 0) {
std::cerr << "Error flushing data at the end: " << cpp_strerror(r)
std::cerr << "rbd: failed to flush at the end: " << cpp_strerror(r)
<< std::endl;
}

Expand Down

0 comments on commit f2d1ac2

Please sign in to comment.