From e415f4064a5ec075e2b0be6928f71a3805f3c968 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 27 Mar 2019 19:09:55 -0400 Subject: [PATCH] librbd: new alternative write-around cache layer This is a replacement for the ObjectCacher-based writethrough/ writeback cache. It permits a configurable maximum byte size of in-flight writes (bytes) to the OSDs where the writes are immediately completed back to the caller. Any IO errors are propagated on the next flush request. Signed-off-by: Jason Dillaman --- src/common/options.cc | 5 + src/librbd/CMakeLists.txt | 1 + src/librbd/cache/WriteAroundObjectDispatch.cc | 510 ++++++++++++++ src/librbd/cache/WriteAroundObjectDispatch.h | 197 ++++++ src/librbd/image/OpenRequest.cc | 28 +- src/test/librbd/CMakeLists.txt | 1 + .../test_mock_WriteAroundObjectDispatch.cc | 636 ++++++++++++++++++ src/test/librbd/test_Migration.cc | 4 +- 8 files changed, 1372 insertions(+), 10 deletions(-) create mode 100644 src/librbd/cache/WriteAroundObjectDispatch.cc create mode 100644 src/librbd/cache/WriteAroundObjectDispatch.h create mode 100644 src/test/librbd/cache/test_mock_WriteAroundObjectDispatch.cc diff --git a/src/common/options.cc b/src/common/options.cc index 36ed0fbb355..849aa94b135 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6990,6 +6990,11 @@ static std::vector