]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add _record_allocated_shares, which records the results of share
authorKevan <kevan@isnotajoke.com>
Sun, 15 Jan 2012 02:50:37 +0000 (18:50 -0800)
committerDaira Hopwood <david-sarah@jacaranda.org>
Thu, 25 Apr 2013 16:49:30 +0000 (17:49 +0100)
allocations.

src/allmydata/immutable/upload.py

index 32a2d7becaf62a4d8213ec2d44bb194bef525e74..82441002b8dd039cfd9a71cbf7fa5d62187c39fb 100644 (file)
@@ -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())