Ticket #1127: homeless_shares_in_a_set.dpatch.txt

File homeless_shares_in_a_set.dpatch.txt, 14.2 KB (added by zooko, at 2010-07-19T05:39:15Z)
Line 
1Sun Jul 18 23:24:14 MDT 2010  zooko@zooko.com
2  * immutable: tidy-up some code by using a set instead of list to hold homeless_shares
3
4New patches:
5
6[immutable: tidy-up some code by using a set instead of list to hold homeless_shares
7zooko@zooko.com**20100719052414
8 Ignore-this: 66636d9b9bf877832ca8b7ce23c41032
9] {
10hunk ./src/allmydata/immutable/upload.py 182
11         self.servers_of_happiness = servers_of_happiness
12         self.needed_shares = needed_shares
13 
14-        self.homeless_shares = range(total_shares)
15+        self.homeless_shares = set(range(total_shares))
16         self.contacted_peers = [] # peers worth asking again
17         self.contacted_peers2 = [] # peers that we have asked again
18         self._started_second_pass = False
19hunk ./src/allmydata/immutable/upload.py 292
20                     level=log.NOISY, parent=self._log_parent)
21             for bucket in buckets:
22                 self.preexisting_shares.setdefault(bucket, set()).add(peer)
23-                if self.homeless_shares and bucket in self.homeless_shares:
24-                    self.homeless_shares.remove(bucket)
25+                self.homeless_shares.discard(bucket)
26             self.full_count += 1
27             self.bad_query_count += 1
28 
29hunk ./src/allmydata/immutable/upload.py 353
30                         server, sharelist = items.pop()
31                         if len(sharelist) > 1:
32                             share = sharelist.pop()
33-                            self.homeless_shares.append(share)
34+                            self.homeless_shares.add(share)
35                             self.preexisting_shares[share].remove(server)
36                             if not self.preexisting_shares[share]:
37                                 del self.preexisting_shares[share]
38hunk ./src/allmydata/immutable/upload.py 373
39             # TODO: don't pre-convert all peerids to PeerTrackers
40             assert isinstance(peer, PeerTracker)
41 
42-            shares_to_ask = set([self.homeless_shares.pop(0)])
43+            shares_to_ask = set([self.homeless_shares.pop()])
44             self.query_count += 1
45             self.num_peers_contacted += 1
46             if self._status:
47hunk ./src/allmydata/immutable/upload.py 394
48             num_shares = mathutil.div_ceil(len(self.homeless_shares),
49                                            len(self.contacted_peers))
50             peer = self.contacted_peers.pop(0)
51-            shares_to_ask = set(self.homeless_shares[:num_shares])
52-            self.homeless_shares[:num_shares] = []
53+            shares_to_ask = set(list(self.homeless_shares)[:num_shares])
54+            self.homeless_shares -= shares_to_ask
55             self.query_count += 1
56             if self._status:
57                 self._status.set_status("Contacting Peers [%s] (second query),"
58hunk ./src/allmydata/immutable/upload.py 442
59                     level=log.UNUSUAL, parent=self._log_parent)
60             self.error_count += 1
61             self.bad_query_count += 1
62-            self.homeless_shares = list(shares_to_ask) + self.homeless_shares
63+            self.homeless_shares |= shares_to_ask
64             if (self.uncontacted_peers
65                 or self.contacted_peers
66                 or self.contacted_peers2):
67hunk ./src/allmydata/immutable/upload.py 503
68 
69                 # some shares are still homeless, keep trying to find them a
70                 # home. The ones that were rejected get first priority.
71-                self.homeless_shares = (list(still_homeless)
72-                                        + self.homeless_shares)
73+                self.homeless_shares |= still_homeless
74                 # Since they were unable to accept all of our requests, so it
75                 # is safe to assume that asking them again won't help.
76             else:
77}
78
79Context:
80
81[docs/logging.txt: document that _trial_temp/test.log does not receive messages below level=OPERATIONAL, due to <http://foolscap.lothar.com/trac/ticket/154>.
82david-sarah@jacaranda.org**20100718230420
83 Ignore-this: aef40f2e74ddeabee5e122e8d80893a1
84]
85[immutable: test for #1124
86zooko@zooko.com**20100718222907
87 Ignore-this: 1766e3cbab92ea2a9e246f40eb6e770b
88]
89[trivial: fix unused import (sorry about that, pyflakes)
90zooko@zooko.com**20100718215133
91 Ignore-this: c2414e443405072b51d552295f2c0e8c
92]
93[tests, NEWS, CREDITS re: #1117
94zooko@zooko.com**20100718203225
95 Ignore-this: 1f08be2c692fb72cc0dd023259f11354
96 Give Brian and Kevan promotions, move release date in NEWS to the 18th, commit Brian's test for #1117.
97 fixes #1117
98]
99[test/test_upload.py: test to see that aborted buckets are ignored by the storage server
100Kevan Carstensen <kevan@isnotajoke.com>**20100716001046
101 Ignore-this: cc075c24b1c86d737f3199af894cc780
102]
103[test/test_storage.py: test for the new remote_abort semantics.
104Kevan Carstensen <kevan@isnotajoke.com>**20100715232148
105 Ignore-this: d3d6491f17bf670e770ca4b385007515
106]
107[storage/immutable.py: make remote_abort btell the storage server about aborted buckets.
108Kevan Carstensen <kevan@isnotajoke.com>**20100715232105
109 Ignore-this: 16ab0090676355abdd5600ed44ff19c9
110]
111[test/test_upload.py: changes to test plumbing for #1117 tests
112Kevan Carstensen <kevan@isnotajoke.com>**20100715231820
113 Ignore-this: 78a6d359d7bf8529d283e2815bf1e2de
114 
115     - Add a callRemoteOnly method to FakeBucketWriter.
116     - Change the abort method in FakeBucketWriter to not return a
117       RuntimeError.
118]
119[immutable/upload.py: abort buckets if peer selection fails
120Kevan Carstensen <kevan@isnotajoke.com>**20100715231714
121 Ignore-this: 2a0b643a22284df292d8ed9d91b1fd37
122]
123[test_encodingutil: correct an error in the previous patch to StdlibUnicode.test_open_representable.
124david-sarah@jacaranda.org**20100718151420
125 Ignore-this: af050955f623fbc0e4d78e15a0a8a144
126]
127[NEWS: Forward-compatibility improvements for non-ASCII caps (#1051).
128david-sarah@jacaranda.org**20100718143622
129 Ignore-this: 1edfebc4bd38a3b5c35e75c99588153f
130]
131[test_dirnode and test_web: don't use failUnlessReallyEqual in cases where the return type from simplejson.loads can vary between unicode and str. Use to_str when comparing URIs parsed from JSON.
132david-sarah@jacaranda.org**20100718142915
133 Ignore-this: c4e78ef4b1478dd400da71cf077ffa4a
134]
135[test_encodingutil: StdlibUnicode.test_open_representable no longer uses a mock.
136david-sarah@jacaranda.org**20100718125412
137 Ignore-this: 4bf373a5e2dfe4209e5e364124af29a3
138]
139[docs: add comment clarifying #1051
140zooko@zooko.com**20100718053250
141 Ignore-this: 6cfc0930434cbdbbc262dabb58f1505d
142]
143[docs: update NEWS
144zooko@zooko.com**20100718053225
145 Ignore-this: 63d5c782ef84812e6d010f0590866831
146]
147[Add tests of caps from the future that have non-ASCII characters in them (encoded as UTF-8). The changes to test_uri.py, test_client.py, and test_dirnode.py add tests of non-ASCII future caps in addition to the current tests. The changes to test_web.py just replace the tests of all-ASCII future caps with tests of non-ASCII future caps. We also change uses of failUnlessEqual to failUnlessReallyEqual, in order to catch cases where the type of a string is not as expected.
148david-sarah@jacaranda.org**20100711200252
149 Ignore-this: c2f193352369d32e06865f8f3e951894
150]
151[Debian documentation update
152jacob@appelbaum.net**20100305003004]
153[debian-docs-patch-final
154jacob@appelbaum.net**20100304085955]
155[M-x whitespace-cleanup
156zooko@zooko.com**20100718032739
157 Ignore-this: babfd4af6ad2fc885c957fd5c8b10c3f
158]
159[docs: tidy up NEWS a little
160zooko@zooko.com**20100718032434
161 Ignore-this: 54f2820fd1a37c8967609f6bfc4e5e18
162]
163[benchmarking: update bench_dirnode.py to reflect the new directory interfaces
164zooko@zooko.com**20100718031710
165 Ignore-this: 368ba523dd3de80d9da29cd58afbe827
166]
167[test_encodingutil: fix test_open_representable, which is only valid when run on a platform for which we know an unrepresentable filename.
168david-sarah@jacaranda.org**20100718030333
169 Ignore-this: c114d92c17714a5d4ae005c15267d60c
170]
171[iputil.py: Add support for FreeBSD 7,8 and 9
172francois@ctrlaltdel.ch**20100718022832
173 Ignore-this: 1829b4cf4b91107f4cf87841e6167e99
174 committed by: zooko@zooko.com
175 date: 2010-07-17
176 and I also patched: NEWS and CREDITS
177]
178[NEWS: add snippet about #1083
179zooko@zooko.com**20100718020653
180 Ignore-this: d353a9d93cbc5a5e6ba4671f78d1e22b
181]
182[fileutil: docstrings for non-obvious usage restrictions on methods of EncryptedTemporaryFile.
183david-sarah@jacaranda.org**20100717054647
184 Ignore-this: 46d8fc10782fa8ec2b6c5b168c841943
185]
186[Move EncryptedTemporaryFile from SFTP frontend to allmydata.util.fileutil, and make the FTP frontend also use it (fixing #1083).
187david-sarah@jacaranda.org**20100711213721
188 Ignore-this: e452e8ca66391aa2a1a49afe0114f317
189]
190[NEWS: reorder NEWS snippets to be in descending order of interestingness
191zooko@zooko.com**20100718015929
192 Ignore-this: 146c42e88a9555a868a04a69dd0e5326
193]
194[Correct stringutils->encodingutil patch to be the newer version, rather than the old version that was committed in error.
195david-sarah@jacaranda.org**20100718013435
196 Ignore-this: c8940c4e1aa2e9acc80cd4fe54753cd8
197]
198[test_cli.py: fix error that crept in when rebasing the patch for #1072.
199david-sarah@jacaranda.org**20100718000123
200 Ignore-this: 3e8f6cc3a27b747c708221dd581934f4
201]
202[stringutils: add test for when sys.stdout has no encoding attribute (fixes #1099).
203david-sarah@jacaranda.org**20100717045816
204 Ignore-this: f28dce6940e909f12f354086d17db54f
205]
206[CLI: add 'tahoe unlink' as an alias to 'tahoe rm', for forward-compatibility.
207david-sarah@jacaranda.org**20100717220411
208 Ignore-this: 3ecdde7f2d0498514cef32e118e0b855
209]
210[minor code clean-up in dirnode.py
211zooko@zooko.com**20100714060255
212 Ignore-this: bb0ab2783203e605024b3e2f798256a1
213 Impose micro-POLA by passing only the writekey instead of the whole node object to {{{_encrypt_rw_uri()}}}. Remove DummyImmutableFileNode in nodemaker.py, which is obviated by this. Add micro-optimization by precomputing the netstring of the empty string and branching on whether the writekey is present or not outside of {{{_encrypt_rw_uri()}}}. Add doc about writekey to docstring.
214 fixes #967
215]
216[Rename stringutils to encodingutil, and drop listdir_unicode and open_unicode (since the Python stdlib functions work fine with Unicode paths). Also move some utility functions to fileutil.
217david-sarah@jacaranda.org**20100712003015
218 Ignore-this: 103b809d180df17a7283077c3104c7be
219]
220[Allow URIs passed in the initial JSON for t=mkdir-with-children, t=mkdir-immutable to be Unicode. Also pass the name of each child into nodemaker.create_from_cap for error reporting.
221david-sarah@jacaranda.org**20100711195525
222 Ignore-this: deac32d8b91ba26ede18905d3f7d2b93
223]
224[docs: CREDITS and NEWS
225zooko@zooko.com**20100714060150
226 Ignore-this: dc83e612f77d69e50ee975f07f6b16fe
227]
228[CREDITS: more creds for Kevan, plus utf-8 BOM
229zooko@zooko.com**20100619045503
230 Ignore-this: 72d02bdd7a0f324f1cee8cd399c7c6de
231]
232[cli.py: make command descriptions consistently end with a full stop.
233david-sarah@jacaranda.org**20100714014538
234 Ignore-this: 9ee7fa29ca2d1631db4049c2a389a97a
235]
236[SFTP: address some of the comments in zooko's review (#1106).
237david-sarah@jacaranda.org**20100712025537
238 Ignore-this: c3921638a2d4f1de2a776ae78e4dc37e
239]
240[docs/logging.txt: note that setting flogging vars might affect tests with race conditions.
241david-sarah@jacaranda.org**20100712050721
242 Ignore-this: fc1609d215fcd5561a57fd1226206f27
243]
244[test_storage.py: potential fix for failures when logging is enabled.
245david-sarah@jacaranda.org**19700713040546
246 Ignore-this: 5815693a0df3e64c52c3c6b7be2846c7
247]
248[upcase_since_on_welcome
249terrellrussell@gmail.com**20100708193903]
250[server_version_on_welcome_page.dpatch.txt
251freestorm77@gmail.com**20100605191721
252 Ignore-this: b450c76dc875f5ac8cca229a666cbd0a
253 
254 
255 - The storage server version is 0 for all storage nodes in the Welcome Page
256 
257 
258]
259[NEWS: add NEWS snippets about two recent patches
260zooko@zooko.com**20100708162058
261 Ignore-this: 6c9da6a0ad7351a960bdd60f81532899
262]
263[directory_html_top_banner.dpatch
264freestorm77@gmail.com**20100622205301
265 Ignore-this: 1d770d975e0c414c996564774f049bca
266 
267 The div tag with the link "Return to Welcome page" on the directory.xhtml page is not correct
268 
269]
270[tahoe_css_toolbar.dpatch
271freestorm77@gmail.com**20100622210046
272 Ignore-this: 5b3ebb2e0f52bbba718a932f80c246c0
273 
274 CSS modification to be correctly diplayed with Internet Explorer 8
275 
276 The links on the top of page directory.xhtml are not diplayed in the same line as display with Firefox.
277 
278]
279[runnin_test_tahoe_css.dpatch
280freestorm77@gmail.com**20100622214714
281 Ignore-this: e0db73d68740aad09a7b9ae60a08c05c
282 
283 Runnin test for changes in tahoe.css file
284 
285]
286[runnin_test_directory_xhtml.dpatch
287freestorm77@gmail.com**20100622201403
288 Ignore-this: f8962463fce50b9466405cb59fe11d43
289 
290 Runnin test for diretory.xhtml top banner
291 
292]
293[stringutils.py: tolerate sys.stdout having no 'encoding' attribute.
294david-sarah@jacaranda.org**20100626040817
295 Ignore-this: f42cad81cef645ee38ac1df4660cc850
296]
297[quickstart.html: python 2.5 -> 2.6 as recommended version
298david-sarah@jacaranda.org**20100705175858
299 Ignore-this: bc3a14645ea1d5435002966ae903199f
300]
301[SFTP: don't call .stopProducing on the producer registered with OverwriteableFileConsumer (which breaks with warner's new downloader).
302david-sarah@jacaranda.org**20100628231926
303 Ignore-this: 131b7a5787bc85a9a356b5740d9d996f
304]
305[docs/how_to_make_a_tahoe-lafs_release.txt: trivial correction, install.html should now be quickstart.html.
306david-sarah@jacaranda.org**20100625223929
307 Ignore-this: 99a5459cac51bd867cc11ad06927ff30
308]
309[setup: in the Makefile, refuse to upload tarballs unless someone has passed the environment variable "BB_BRANCH" with value "trunk"
310zooko@zooko.com**20100619034928
311 Ignore-this: 276ddf9b6ad7ec79e27474862e0f7d6
312]
313[trivial: tiny update to in-line comment
314zooko@zooko.com**20100614045715
315 Ignore-this: 10851b0ed2abfed542c97749e5d280bc
316 (I'm actually committing this patch as a test of the new eager-annotation-computation of trac-darcs.)
317]
318[docs: about.html link to home page early on, and be decentralized storage instead of cloud storage this time around
319zooko@zooko.com**20100619065318
320 Ignore-this: dc6db03f696e5b6d2848699e754d8053
321]
322[docs: update about.html, especially to have a non-broken link to quickstart.html, and also to comment out the broken links to "for Paranoids" and "for Corporates"
323zooko@zooko.com**20100619065124
324 Ignore-this: e292c7f51c337a84ebfeb366fbd24d6c
325]
326[TAG allmydata-tahoe-1.7.0
327zooko@zooko.com**20100619052631
328 Ignore-this: d21e27afe6d85e2e3ba6a3292ba2be1
329]
330Patch bundle hash:
3313d97c83a6ff525b6345eacc6f2fd38f81503ebaa