Add temporary get_new_servers_responding().
self._count_good_share_hosts = count_good_share_hosts
self._count_recoverable_versions = count_recoverable_versions
self._count_unrecoverable_versions = count_unrecoverable_versions
- for s in servers_responding:
- assert isinstance(s, str), s
+ for server in servers_responding:
+ assert IDisplayableServer.providedBy(server), server
self._servers_responding = servers_responding
for shnum, servers in sharemap.items():
for server in servers:
def get_incompatible_shares(self):
return self._list_incompatible_shares
- def get_servers_responding(self):
+ def get_new_servers_responding(self):
return self._servers_responding
+ def get_servers_responding(self):
+ return [s.get_serverid() for s in self._servers_responding]
def get_host_counter_good_shares(self):
return self._count_good_share_hosts
sharemap = {}
for shnum, servers in self._sharemap.items():
sharemap[shnum] = sorted([s.get_serverid() for s in servers])
+ responding = [s.get_serverid() for s in self._servers_responding]
d = {"count-shares-needed": self._count_shares_needed,
"count-shares-expected": self._count_shares_expected,
"count-shares-good": self._count_shares_good,
"count-good-share-hosts": self._count_good_share_hosts,
"count-recoverable-versions": self._count_recoverable_versions,
"count-unrecoverable-versions": self._count_unrecoverable_versions,
- "servers-responding": self._servers_responding,
+ "servers-responding": responding,
"sharemap": sharemap,
"count-wrong-shares": self._count_wrong_shares,
"list-corrupt-shares": self._list_corrupt_shares,
SI = self._verifycap.get_storage_index()
verifiedshares = dictutil.DictOfSets() # {sharenum: set(server)}
- servers = {} # {serverid: set(sharenums)}
+ servers = {} # {server: set(sharenums)}
corruptshare_locators = [] # (serverid, storageindex, sharenum)
incompatibleshare_locators = [] # (serverid, storageindex, sharenum)
servers_responding = set() # serverid
for verified, server, corrupt, incompatible, responded in results:
server_id = server.get_serverid()
- servers.setdefault(server_id, set()).update(verified)
+ servers.setdefault(server, set()).update(verified)
for sharenum in verified:
verifiedshares.setdefault(sharenum, set()).add(server)
for sharenum in corrupt:
for sharenum in incompatible:
incompatibleshare_locators.append((server_id, SI, sharenum))
if responded:
- servers_responding.add(server_id)
+ servers_responding.add(server)
good_share_hosts = len([s for s in servers.keys() if servers[s]])
# prr (post-repair results)
verifycap = self._verifycap
- servers_responding = set(cr.get_servers_responding())
+ servers_responding = set(cr.get_new_servers_responding())
sm = DictOfSets()
assert isinstance(cr.get_sharemap(), DictOfSets)
for shnum, servers in cr.get_new_sharemap().items():
for shnum, servers in ur.get_sharemap().items():
for server in servers:
sm.add(shnum, server)
- servers_responding.add(server.get_serverid())
+ servers_responding.add(server)
servers_responding = sorted(servers_responding)
good_hosts = len(reduce(set.union, sm.values(), set()))
for (shnum, server, timestamp) in vmap[verinfo]:
shareid = "%s-sh%d" % (smap.summarize_version(verinfo), shnum)
sharemap.add(shareid, server)
- servers_responding = [s.get_serverid() for s in
- list(smap.get_reachable_servers())]
if healthy:
summary = "Healthy"
else:
count_good_share_hosts=counters["count-good-share-hosts"],
count_recoverable_versions=len(recoverable),
count_unrecoverable_versions=len(unrecoverable),
- servers_responding=servers_responding,
+ servers_responding=list(smap.get_reachable_servers()),
sharemap=sharemap,
count_wrong_shares=counters["count-wrong-shares"],
list_corrupt_shares=corrupt_share_locators,
return self.storage_index
def check(self, monitor, verify=False, add_lease=False):
- nodeid = "\x00"*20
- s = StubServer(nodeid)
+ s = StubServer("\x00"*20)
r = CheckResults(self.my_uri, self.storage_index,
healthy=True, recoverable=True,
needs_rebalancing=False,
count_good_share_hosts=10,
count_recoverable_versions=1,
count_unrecoverable_versions=0,
- servers_responding=[nodeid],
+ servers_responding=[s],
sharemap={1: [s]},
count_wrong_shares=0,
list_corrupt_shares=[],
return self.file_types[self.storage_index]
def check(self, monitor, verify=False, add_lease=False):
- nodeid = "\x00"*20
- s = StubServer(nodeid)
+ s = StubServer("\x00"*20)
r = CheckResults(self.my_uri, self.storage_index,
healthy=True, recoverable=True,
needs_rebalancing=False,
count_good_share_hosts=10,
count_recoverable_versions=1,
count_unrecoverable_versions=0,
- servers_responding=[nodeid],
+ servers_responding=[s],
sharemap={"seq1-abcd-sh0": [s]},
count_wrong_shares=0,
list_corrupt_shares=[],