From: David-Sarah Hopwood Date: Sun, 18 Nov 2012 05:00:13 +0000 (+0000) Subject: Remove the 'original-*' and 'configured-*' lease crawler output that won't be support... X-Git-Url: https://git.rkrishnan.org/simplejson/using.html?a=commitdiff_plain;h=dbd6321f3756165eb32b5dfda6f8e4bf23a8105d;p=tahoe-lafs%2Ftahoe-lafs.git Remove the 'original-*' and 'configured-*' lease crawler output that won't be supported by the accounting crawler. Signed-off-by: David-Sarah Hopwood --- diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index ad7b3136..8e3e1c2b 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -3109,8 +3109,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): self.failUnlessEqual(sr1["examined-buckets"], 1) self.failUnlessEqual(sr1["examined-shares"], 1) self.failUnlessEqual(sr1["actual-shares"], 0) - self.failUnlessEqual(sr1["configured-diskbytes"], 0) - self.failUnlessEqual(sr1["original-sharebytes"], 0) left = initial_state["estimated-remaining-cycle"] sr2 = left["space-recovered"] self.failUnless(sr2["examined-buckets"] > 0, sr2["examined-buckets"]) @@ -3127,20 +3125,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): self.failUnlessIn("and has recovered: " "0 shares, 0 buckets (0 mutable / 0 immutable), " "0 B (0 B / 0 B)", s) - self.failUnlessIn("If expiration were enabled, " - "we would have recovered: " - "0 shares, 0 buckets (0 mutable / 0 immutable)," - " 0 B (0 B / 0 B) by now", s) - self.failUnlessIn("and the remainder of this cycle " - "would probably recover: " - "0 shares, 0 buckets (0 mutable / 0 immutable)," - " 0 B (0 B / 0 B)", s) - self.failUnlessIn("and the whole cycle would probably recover: " - "0 shares, 0 buckets (0 mutable / 0 immutable)," - " 0 B (0 B / 0 B)", s) - self.failUnlessIn("if we were strictly using each lease's default " - "31-day lease lifetime", s) - self.failUnlessIn("this cycle would be expected to recover: ", s) d.addCallback(_check_html_in_cycle) # wait for the crawler to finish the first cycle. Nothing should have @@ -3173,17 +3157,8 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): self.failUnlessEqual(rec["examined-buckets"], 4) self.failUnlessEqual(rec["examined-shares"], 4) self.failUnlessEqual(rec["actual-buckets"], 0) - self.failUnlessEqual(rec["original-buckets"], 0) - self.failUnlessEqual(rec["configured-buckets"], 0) self.failUnlessEqual(rec["actual-shares"], 0) - self.failUnlessEqual(rec["original-shares"], 0) - self.failUnlessEqual(rec["configured-shares"], 0) self.failUnlessEqual(rec["actual-diskbytes"], 0) - self.failUnlessEqual(rec["original-diskbytes"], 0) - self.failUnlessEqual(rec["configured-diskbytes"], 0) - self.failUnlessEqual(rec["actual-sharebytes"], 0) - self.failUnlessEqual(rec["original-sharebytes"], 0) - self.failUnlessEqual(rec["configured-sharebytes"], 0) def _get_sharefile(si): return list(server._iter_share_files(si))[0] @@ -3269,7 +3244,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): sf0 = _get_sharefile(immutable_si_0) self.backdate_lease(sf0, self.renew_secrets[0], now - 1000) - sf0_size = os.stat(sf0.home).st_size # immutable_si_1 gets an extra lease sf1 = _get_sharefile(immutable_si_1) @@ -3277,7 +3251,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): sf2 = _get_sharefile(mutable_si_2) self.backdate_lease(sf2, self.renew_secrets[3], now - 1000) - sf2_size = os.stat(sf2.home).st_size # mutable_si_3 gets an extra lease sf3 = _get_sharefile(mutable_si_3) @@ -3335,23 +3308,11 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): self.failUnlessEqual(rec["examined-buckets"], 4) self.failUnlessEqual(rec["examined-shares"], 4) self.failUnlessEqual(rec["actual-buckets"], 2) - self.failUnlessEqual(rec["original-buckets"], 2) - self.failUnlessEqual(rec["configured-buckets"], 2) self.failUnlessEqual(rec["actual-shares"], 2) - self.failUnlessEqual(rec["original-shares"], 2) - self.failUnlessEqual(rec["configured-shares"], 2) - size = sf0_size + sf2_size - self.failUnlessEqual(rec["actual-sharebytes"], size) - self.failUnlessEqual(rec["original-sharebytes"], size) - self.failUnlessEqual(rec["configured-sharebytes"], size) # different platforms have different notions of "blocks used by # this file", so merely assert that it's a number self.failUnless(rec["actual-diskbytes"] >= 0, rec["actual-diskbytes"]) - self.failUnless(rec["original-diskbytes"] >= 0, - rec["original-diskbytes"]) - self.failUnless(rec["configured-diskbytes"] >= 0, - rec["configured-diskbytes"]) d.addCallback(_after_first_cycle) d.addCallback(lambda ign: self.render1(webstatus)) def _check_html(html): @@ -3413,7 +3374,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): sf0 = _get_sharefile(immutable_si_0) self.backdate_lease(sf0, self.renew_secrets[0], new_expiration_time) - sf0_size = os.stat(sf0.home).st_size # immutable_si_1 gets an extra lease sf1 = _get_sharefile(immutable_si_1) @@ -3421,7 +3381,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): sf2 = _get_sharefile(mutable_si_2) self.backdate_lease(sf2, self.renew_secrets[3], new_expiration_time) - sf2_size = os.stat(sf2.home).st_size # mutable_si_3 gets an extra lease sf3 = _get_sharefile(mutable_si_3) @@ -3481,23 +3440,11 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): self.failUnlessEqual(rec["examined-buckets"], 4) self.failUnlessEqual(rec["examined-shares"], 4) self.failUnlessEqual(rec["actual-buckets"], 2) - self.failUnlessEqual(rec["original-buckets"], 0) - self.failUnlessEqual(rec["configured-buckets"], 2) self.failUnlessEqual(rec["actual-shares"], 2) - self.failUnlessEqual(rec["original-shares"], 0) - self.failUnlessEqual(rec["configured-shares"], 2) - size = sf0_size + sf2_size - self.failUnlessEqual(rec["actual-sharebytes"], size) - self.failUnlessEqual(rec["original-sharebytes"], 0) - self.failUnlessEqual(rec["configured-sharebytes"], size) # different platforms have different notions of "blocks used by # this file", so merely assert that it's a number self.failUnless(rec["actual-diskbytes"] >= 0, rec["actual-diskbytes"]) - self.failUnless(rec["original-diskbytes"] >= 0, - rec["original-diskbytes"]) - self.failUnless(rec["configured-diskbytes"] >= 0, - rec["configured-diskbytes"]) d.addCallback(_after_first_cycle) d.addCallback(lambda ign: self.render1(webstatus)) def _check_html(html): @@ -3605,33 +3552,13 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin): left = s["estimated-remaining-cycle"]["space-recovered"] self.failUnlessEqual(left["actual-buckets"], None) - self.failUnlessEqual(left["original-buckets"], None) - self.failUnlessEqual(left["configured-buckets"], None) self.failUnlessEqual(left["actual-shares"], None) - self.failUnlessEqual(left["original-shares"], None) - self.failUnlessEqual(left["configured-shares"], None) self.failUnlessEqual(left["actual-diskbytes"], None) - self.failUnlessEqual(left["original-diskbytes"], None) - self.failUnlessEqual(left["configured-diskbytes"], None) - self.failUnlessEqual(left["actual-sharebytes"], None) - self.failUnlessEqual(left["original-sharebytes"], None) - self.failUnlessEqual(left["configured-sharebytes"], None) full = s["estimated-remaining-cycle"]["space-recovered"] self.failUnlessEqual(full["actual-buckets"], None) - self.failUnlessEqual(full["original-buckets"], None) - self.failUnlessEqual(full["configured-buckets"], None) self.failUnlessEqual(full["actual-shares"], None) - self.failUnlessEqual(full["original-shares"], None) - self.failUnlessEqual(full["configured-shares"], None) self.failUnlessEqual(full["actual-diskbytes"], None) - self.failUnlessEqual(full["original-diskbytes"], None) - self.failUnlessEqual(full["configured-diskbytes"], None) - self.failUnlessEqual(full["actual-sharebytes"], None) - self.failUnlessEqual(full["original-sharebytes"], None) - self.failUnlessEqual(full["configured-sharebytes"], None) - - d.addCallback(_check) return d def BROKEN_test_no_st_blocks(self): diff --git a/src/allmydata/web/storage.py b/src/allmydata/web/storage.py index 6bb27850..cb3b2804 100644 --- a/src/allmydata/web/storage.py +++ b/src/allmydata/web/storage.py @@ -208,19 +208,8 @@ class StorageStatus(rend.Page): add("The whole cycle is expected to examine %s shares in %s buckets" % (maybe(ecr["examined-shares"]), maybe(ecr["examined-buckets"]))) add("and to recover: ", self.format_recovered(ecr, "actual")) - else: - add("If expiration were enabled, we would have recovered: ", - self.format_recovered(sr, "configured"), " by now") - add("and the remainder of this cycle would probably recover: ", - self.format_recovered(esr, "configured")) - add("and the whole cycle would probably recover: ", - self.format_recovered(ecr, "configured")) - - add("if we were strictly using each lease's default 31-day lease lifetime " - "(instead of our configured behavior), " - "this cycle would be expected to recover: ", - self.format_recovered(ecr, "original")) + add("Expiration was not enabled.") if so_far["corrupt-shares"]: add("Corrupt shares:", @@ -252,9 +241,7 @@ class StorageStatus(rend.Page): add("and saw a total of ", saw) if not last["expiration-enabled"]: - rec = self.format_recovered(last["space-recovered"], "configured") - add("but expiration was not enabled. If it had been, " - "it would have recovered: ", rec) + add("but expiration was not enabled.") if last["corrupt-shares"]: add("Corrupt shares:",