From 7f5e1ce326e3bd55c8a16b4345a0bf284b6aef5a Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 16 Oct 2021 23:12:34 +0200 Subject: [PATCH 1/3] test/librbd: set FUA on writes in remove_full_try() Work around write-back or write-around cache getting enabled (e.g. if one runs the tests with rbd_cache_writethrough_until_flush disabled). Fixes: https://tracker.ceph.com/issues/52883 Signed-off-by: Ilya Dryomov --- src/test/librbd/test_librbd.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 1ea88f1ca68e0..825b915d0992d 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -2145,7 +2145,8 @@ static void remove_full_try(rados_ioctx_t ioctx, const std::string& image_name, ssize_t ret; for (off = 0; off < size; off += len) { ret = rbd_write_zeroes(image, off, len, - RBD_WRITE_ZEROES_FLAG_THICK_PROVISION, 0); + RBD_WRITE_ZEROES_FLAG_THICK_PROVISION, + LIBRADOS_OP_FLAG_FADVISE_FUA); if (ret < 0) { break; } From 641f782ac7fbb98c36dc41085a616c5cabf3cb20 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 14 Oct 2021 20:35:16 +0200 Subject: [PATCH 2/3] test/librbd: don't run RemoveFullTry tests with persistent writeback cache Persistent writeback cache messes with pool quota enforcement on the OSD side and we don't always break out of the write zeroes loop: src/test/librbd/test_librbd.cc:2165: Failure Value of: off >= quota && off < size Actual: false Expected: true Unfortunately persistent writeback cache doesn't honor FUA [1] so the workaround for volatile caches from the previous patch doesn't apply. [1] https://tracker.ceph.com/issues/49715 Signed-off-by: Ilya Dryomov --- src/test/librbd/test_librbd.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 825b915d0992d..dd5f492a47c39 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -2165,6 +2165,7 @@ static void remove_full_try(rados_ioctx_t ioctx, const std::string& image_name, TEST_F(TestLibRBD, RemoveFullTry) { + REQUIRE(!is_rbd_pwl_enabled((CephContext *)_rados.cct())); REQUIRE(!is_librados_test_stub(_rados)); rados_ioctx_t ioctx; @@ -2189,6 +2190,7 @@ TEST_F(TestLibRBD, RemoveFullTry) TEST_F(TestLibRBD, RemoveFullTryDataPool) { REQUIRE_FORMAT_V2(); + REQUIRE(!is_rbd_pwl_enabled((CephContext *)_rados.cct())); REQUIRE(!is_librados_test_stub(_rados)); rados_ioctx_t ioctx; From 6278a04ac2490632bfc6da8af16bcac5df5b50fa Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 14 Oct 2021 21:40:49 +0200 Subject: [PATCH 3/3] qa/suites/rbd: whitelist POOL_FULL due to quota for test_librbd.sh RemoveFullTry tests fill up the pool and expect EDQUOT. Signed-off-by: Ilya Dryomov --- qa/suites/crimson-rados/rbd/tasks/rbd_api_tests_old_format.yaml | 2 ++ qa/suites/rbd/basic/tasks/rbd_api_tests_old_format.yaml | 2 ++ qa/suites/rbd/librbd/workloads/c_api_tests.yaml | 2 ++ qa/suites/rbd/librbd/workloads/c_api_tests_with_defaults.yaml | 2 ++ qa/suites/rbd/librbd/workloads/c_api_tests_with_journaling.yaml | 2 ++ qa/suites/rbd/thrash/workloads/rbd_api_tests.yaml | 2 ++ qa/suites/rbd/thrash/workloads/rbd_api_tests_copy_on_read.yaml | 2 ++ qa/suites/rbd/thrash/workloads/rbd_api_tests_journaling.yaml | 2 ++ qa/suites/rbd/thrash/workloads/rbd_api_tests_no_locking.yaml | 2 ++ qa/suites/rbd/valgrind/workloads/c_api_tests.yaml | 2 ++ qa/suites/rbd/valgrind/workloads/c_api_tests_with_defaults.yaml | 2 ++ .../rbd/valgrind/workloads/c_api_tests_with_journaling.yaml | 2 ++ qa/suites/smoke/basic/tasks/test/rbd_api_tests.yaml | 1 + 13 files changed, 25 insertions(+) diff --git a/qa/suites/crimson-rados/rbd/tasks/rbd_api_tests_old_format.yaml b/qa/suites/crimson-rados/rbd/tasks/rbd_api_tests_old_format.yaml index 36393831a3bda..3dbb69df40fc6 100644 --- a/qa/suites/crimson-rados/rbd/tasks/rbd_api_tests_old_format.yaml +++ b/qa/suites/crimson-rados/rbd/tasks/rbd_api_tests_old_format.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/basic/tasks/rbd_api_tests_old_format.yaml b/qa/suites/rbd/basic/tasks/rbd_api_tests_old_format.yaml index 36393831a3bda..3dbb69df40fc6 100644 --- a/qa/suites/rbd/basic/tasks/rbd_api_tests_old_format.yaml +++ b/qa/suites/rbd/basic/tasks/rbd_api_tests_old_format.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/librbd/workloads/c_api_tests.yaml b/qa/suites/rbd/librbd/workloads/c_api_tests.yaml index 3073d77a8cdfe..ac9dd3cfe010d 100644 --- a/qa/suites/rbd/librbd/workloads/c_api_tests.yaml +++ b/qa/suites/rbd/librbd/workloads/c_api_tests.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/librbd/workloads/c_api_tests_with_defaults.yaml b/qa/suites/rbd/librbd/workloads/c_api_tests_with_defaults.yaml index 35c4b0848563d..c410fbcb0d3fd 100644 --- a/qa/suites/rbd/librbd/workloads/c_api_tests_with_defaults.yaml +++ b/qa/suites/rbd/librbd/workloads/c_api_tests_with_defaults.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/librbd/workloads/c_api_tests_with_journaling.yaml b/qa/suites/rbd/librbd/workloads/c_api_tests_with_journaling.yaml index 6fae0fea93dc4..3a121de3eae07 100644 --- a/qa/suites/rbd/librbd/workloads/c_api_tests_with_journaling.yaml +++ b/qa/suites/rbd/librbd/workloads/c_api_tests_with_journaling.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/thrash/workloads/rbd_api_tests.yaml b/qa/suites/rbd/thrash/workloads/rbd_api_tests.yaml index 35c4b0848563d..c410fbcb0d3fd 100644 --- a/qa/suites/rbd/thrash/workloads/rbd_api_tests.yaml +++ b/qa/suites/rbd/thrash/workloads/rbd_api_tests.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/thrash/workloads/rbd_api_tests_copy_on_read.yaml b/qa/suites/rbd/thrash/workloads/rbd_api_tests_copy_on_read.yaml index 8f929162e716d..ce47fc46f62ac 100644 --- a/qa/suites/rbd/thrash/workloads/rbd_api_tests_copy_on_read.yaml +++ b/qa/suites/rbd/thrash/workloads/rbd_api_tests_copy_on_read.yaml @@ -11,6 +11,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) conf: client: rbd clone copy on read: true diff --git a/qa/suites/rbd/thrash/workloads/rbd_api_tests_journaling.yaml b/qa/suites/rbd/thrash/workloads/rbd_api_tests_journaling.yaml index 6fae0fea93dc4..3a121de3eae07 100644 --- a/qa/suites/rbd/thrash/workloads/rbd_api_tests_journaling.yaml +++ b/qa/suites/rbd/thrash/workloads/rbd_api_tests_journaling.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/thrash/workloads/rbd_api_tests_no_locking.yaml b/qa/suites/rbd/thrash/workloads/rbd_api_tests_no_locking.yaml index 3073d77a8cdfe..ac9dd3cfe010d 100644 --- a/qa/suites/rbd/thrash/workloads/rbd_api_tests_no_locking.yaml +++ b/qa/suites/rbd/thrash/workloads/rbd_api_tests_no_locking.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/valgrind/workloads/c_api_tests.yaml b/qa/suites/rbd/valgrind/workloads/c_api_tests.yaml index 3073d77a8cdfe..ac9dd3cfe010d 100644 --- a/qa/suites/rbd/valgrind/workloads/c_api_tests.yaml +++ b/qa/suites/rbd/valgrind/workloads/c_api_tests.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/valgrind/workloads/c_api_tests_with_defaults.yaml b/qa/suites/rbd/valgrind/workloads/c_api_tests_with_defaults.yaml index 35c4b0848563d..c410fbcb0d3fd 100644 --- a/qa/suites/rbd/valgrind/workloads/c_api_tests_with_defaults.yaml +++ b/qa/suites/rbd/valgrind/workloads/c_api_tests_with_defaults.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/rbd/valgrind/workloads/c_api_tests_with_journaling.yaml b/qa/suites/rbd/valgrind/workloads/c_api_tests_with_journaling.yaml index 6fae0fea93dc4..3a121de3eae07 100644 --- a/qa/suites/rbd/valgrind/workloads/c_api_tests_with_journaling.yaml +++ b/qa/suites/rbd/valgrind/workloads/c_api_tests_with_journaling.yaml @@ -4,6 +4,8 @@ overrides: - overall HEALTH_ - \(CACHE_POOL_NO_HIT_SET\) - \(POOL_APP_NOT_ENABLED\) + - is full \(reached quota + - \(POOL_FULL\) tasks: - workunit: clients: diff --git a/qa/suites/smoke/basic/tasks/test/rbd_api_tests.yaml b/qa/suites/smoke/basic/tasks/test/rbd_api_tests.yaml index 3e13adb0089e5..cbd0fb27cd146 100644 --- a/qa/suites/smoke/basic/tasks/test/rbd_api_tests.yaml +++ b/qa/suites/smoke/basic/tasks/test/rbd_api_tests.yaml @@ -7,6 +7,7 @@ tasks: - \(PG_ - \(POOL_ - \(CACHE_POOL_ + - is full \(reached quota fs: xfs - ceph-fuse: - workunit: