From ebdc2fb72a12f54940b28dccd95d9d15f25e0fd3 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 15 Dec 2021 10:06:34 -0500 Subject: [PATCH] qa: test reintegration with directory limits Signed-off-by: Patrick Donnelly (cherry picked from commit fe46985a638ee1588855ef41e617b3ef33cde82f) --- qa/tasks/cephfs/test_strays.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/qa/tasks/cephfs/test_strays.py b/qa/tasks/cephfs/test_strays.py index f8313badd0358..7c4834028452f 100644 --- a/qa/tasks/cephfs/test_strays.py +++ b/qa/tasks/cephfs/test_strays.py @@ -344,6 +344,35 @@ class TestStrays(CephFSTestCase): self.await_data_pool_empty() + def test_reintegration_limit(self): + """ + That the reintegration is not blocked by full directories. + """ + + LOW_LIMIT = 50 + self.config_set('mds', 'mds_bal_fragment_size_max', str(LOW_LIMIT)) + time.sleep(10) # for config to reach MDS; async create is fast!! + + last_reintegrated = self.get_mdc_stat("strays_reintegrated") + self.mount_a.run_shell_payload(""" + mkdir a b + for i in `seq 1 50`; do + touch a/"$i" + ln a/"$i" b/"$i" + done + sync -f a b + rm a/* + """) + + self.wait_until_equal( + lambda: self.get_mdc_stat("num_strays"), + expect_val=0, + timeout=60 + ) + curr_reintegrated = self.get_mdc_stat("strays_reintegrated") + self.assertGreater(curr_reintegrated, last_reintegrated) + + def test_hardlink_reintegration(self): """ That removal of primary dentry of hardlinked inode results -- 2.39.5