From 640e42845b4d3d34aa6b49858a40e945d863f818 Mon Sep 17 00:00:00 2001 From: Kevan Date: Sat, 14 Jan 2012 18:50:37 -0800 Subject: [PATCH] Add _record_allocated_shares, which records the results of share allocations. --- src/allmydata/immutable/upload.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 32a2d7be..82441002 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -538,6 +538,11 @@ class Tahoe2ServerSelector(log.PrefixingLogMixin): self.preexisting_shares.setdefault(share, set()).add(serverid) self.homeless_shares.discard(share) + def _record_allocated_shares(self, tracker, shares): + # the ServerTracker will remember which shares were allocated on + # that peer. We just have to remember to use them. + self.use_trackers.add(tracker) + def _got_response(self, res, tracker, shares_to_ask, put_tracker_here): if isinstance(res, failure.Failure): # This is unusual, and probably indicates a bug or a network @@ -573,11 +578,9 @@ class Tahoe2ServerSelector(log.PrefixingLogMixin): progress = True self._record_existing_shares(tracker, alreadygot) - # the ServerTracker will remember which shares were allocated on - # that peer. We just have to remember to use them. if allocated: - self.use_trackers.add(tracker) progress = True + self._record_allocated_shares(tracker, allocated) if allocated or alreadygot: self.serverids_with_shares.add(tracker.get_serverid()) -- 2.45.2