From: Patrick Donnelly Date: Sat, 17 Feb 2024 15:26:14 +0000 (-0500) Subject: qa: detect partial migrations during large config of dist epin X-Git-Tag: v20.0.0~2328^2~21 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a1ac3e03a0227fc386f4341fc55b9a2c2a58d0bc;p=ceph.git 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 --- 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