From a1ac3e03a0227fc386f4341fc55b9a2c2a58d0bc Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 17 Feb 2024 10:26:14 -0500 Subject: [PATCH] qa: detect partial migrations during large config of dist epin This method would wrongly "succeed" when looking for setup of distributed ephemerally pinned directory fragments. If the migrator splits a subtree during the course of migration (to reduce the migration size) then the operation may not actually be complete. Signed-off-by: Patrick Donnelly --- qa/tasks/cephfs/cephfs_test_case.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index dea8a310e31b0..7334a59721735 100644 --- a/qa/tasks/cephfs/cephfs_test_case.py +++ b/qa/tasks/cephfs/cephfs_test_case.py @@ -339,6 +339,7 @@ class CephFSTestCase(CephTestCase): subtrees = [] for r in self.fs.get_ranks(status=status): s = self.fs.rank_asok(["get", "subtrees"], status=status, rank=r['rank']) + log.debug(f"{json.dumps(s, indent=2)}") s = filter(lambda s: s['auth_first'] == r['rank'] and s['auth_second'] == -2, s) subtrees += s else: @@ -384,11 +385,15 @@ class CephFSTestCase(CephTestCase): with contextutil.safe_while(sleep=5, tries=20) as proceed: while proceed(): subtrees = self._get_subtrees(status=status, rank=rank, path=path) - subtrees = list(filter(lambda s: s['distributed_ephemeral_pin'] == True and - s['auth_first'] == s['export_pin_target'], - subtrees)) - log.info(f"len={len(subtrees)} {subtrees}") + dist = list(filter(lambda s: s['distributed_ephemeral_pin'] == True and + s['auth_first'] == s['export_pin_target'], + subtrees)) + log.info(f"len={len(dist)}\n{json.dumps(dist, indent=2)}") + if len(subtrees) >= count: + if len(subtrees) > len(dist): + # partial migration + continue return subtrees except contextutil.MaxWhileTries as e: raise RuntimeError("rank {0} failed to reach desired subtree state".format(rank)) from e -- 2.39.5