]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lost_unfound: list missing/unfound for each pg and verify the unfound counts
authorSage Weil <sage@newdream.net>
Fri, 24 Feb 2012 19:11:59 +0000 (11:11 -0800)
committerSage Weil <sage@newdream.net>
Fri, 24 Feb 2012 20:42:39 +0000 (12:42 -0800)
This also tests the pg list_missing functionality.

teuthology/task/lost_unfound.py

index f86fee82f00549c826ffa089ed91e8e2714737d8..3f89a3e3f8815e4a74359c53192a83c724ee3193 100644 (file)
@@ -125,6 +125,18 @@ def task(ctx, config):
     for pg in pgs:
         if pg['stat_sum']['num_objects_unfound'] > 0:
             primary = 'osd.%d' % pg['acting'][0]
+
+            # verify that i can list them direct from the osd
+            log.info('listing missing/lost in %s', pg['pgid']);
+            m = manager.list_pg_missing(pg['pgid'])
+            #log.info('%s' % m)
+            assert m['num_unfound'] == pg['stat_sum']['num_objects_unfound']
+            num_unfound=0
+            for o in m['objects']:
+                if len(o['locations']) == 0:
+                    num_unfound += 1
+            assert m['num_unfound'] == num_unfound
+
             log.info("reverting unfound in %s on %s", pg['pgid'], primary)
             manager.raw_cluster_cmd('pg', pg['pgid'],
                                     'mark_unfound_lost', 'revert')