Ticket #778: 778codecoverage.darcspatch.txt

File 778codecoverage.darcspatch.txt, 17.7 KB (added by kevan, at 2010-05-15T03:52:56Z)
Line 
1Fri May 14 13:35:16 PDT 2010  Kevan Carstensen <kevan@isnotajoke.com>
2  * Remove a comment that no longer makes sense.
3
4Fri May 14 20:29:13 PDT 2010  Kevan Carstensen <kevan@isnotajoke.com>
5  * Improve code coverage of the Tahoe2PeerSelector tests.
6
7New patches:
8
9[Remove a comment that no longer makes sense.
10Kevan Carstensen <kevan@isnotajoke.com>**20100514203516
11 Ignore-this: 956983c7e7c7e4477215494dfce8f058
12] hunk ./src/allmydata/immutable/upload.py 354
13                 else:
14                     # Redistribution won't help us; fail.
15                     peer_count = len(self.peers_with_shares)
16-                    # If peer_count < needed_shares, then the second error
17-                    # message is nonsensical, so we use this one.
18                     msg = failure_message(peer_count,
19                                           self.needed_shares,
20                                           self.servers_of_happiness,
21[Improve code coverage of the Tahoe2PeerSelector tests.
22Kevan Carstensen <kevan@isnotajoke.com>**20100515032913
23 Ignore-this: 793151b63ffa65fdae6915db22d9924a
24] hunk ./src/allmydata/test/test_upload.py 1742
25     test_problem_layout_comment_187.todo = "this isn't fixed yet"
26 
27 
28+    def test_upload_succeeds_with_some_homeless_shares(self):
29+        # If the upload is forced to stop trying to place shares before
30+        # it has placed (or otherwise accounted) for all of them, but it
31+        # has placed enough to satisfy the upload health criteria that
32+        # we're using, it should still succeed.
33+        self.basedir = self.mktemp()
34+        d = self._setup_and_upload()
35+        def _server_setup(ign):
36+            # Add four servers so that we have a layout like this:
37+            # server 1: share 0, read-only
38+            # server 2: share 1, read-only
39+            # server 3: share 2, read-only
40+            # server 4: share 3, read-only
41+            # If we set happy = 4, the upload will manage to satisfy
42+            # servers of happiness, but not place all of the shares; we
43+            # want to test that the upload is declared successful in
44+            # this case.
45+            self._add_server_with_share(server_number=1, share_number=0,
46+                                        readonly=True)
47+            self._add_server_with_share(server_number=2, share_number=1,
48+                                        readonly=True)
49+            self._add_server_with_share(server_number=3, share_number=2,
50+                                        readonly=True)
51+            self._add_server_with_share(server_number=4, share_number=3,
52+                                        readonly=True)
53+            # Remove server 0.
54+            self.g.remove_server(self.g.servers_by_number[0].my_nodeid)
55+            # Set the client appropriately
56+            c = self.g.clients[0]
57+            c.DEFAULT_ENCODING_PARAMETERS['happy'] = 4
58+            return c
59+        d.addCallback(_server_setup)
60+        d.addCallback(lambda client:
61+            client.upload(upload.Data("data" * 10000, convergence="")))
62+        return d
63+
64+
65+    def test_uploader_skips_over_servers_with_only_one_share(self):
66+        # We want to make sure that the redistribution logic ignores
67+        # servers with only one share, since placing these shares
68+        # elsewhere will at best keep happiness the same as it was, and
69+        # at worst hurt it.
70+        self.basedir = self.mktemp()
71+        d = self._setup_and_upload()
72+        def _server_setup(ign):
73+            # Add some servers so that the upload will need to
74+            # redistribute, but will first pass over a couple of servers
75+            # that don't have enough shares to redistribute before
76+            # finding one that does have shares to redistribute.
77+            self._add_server_with_share(server_number=1, share_number=0)
78+            self._add_server_with_share(server_number=2, share_number=2)
79+            self._add_server_with_share(server_number=3, share_number=1)
80+            self._add_server_with_share(server_number=8, share_number=4)
81+            self._add_server_with_share(server_number=5, share_number=5)
82+            self._add_server_with_share(server_number=10, share_number=7)
83+            for i in xrange(4):
84+                self._copy_share_to_server(i, 2)
85+            return self.g.clients[0]
86+        d.addCallback(_server_setup)
87+        d.addCallback(lambda client:
88+            client.upload(upload.Data("data" * 10000, convergence="")))
89+        return d
90+
91+
92     def _set_up_nodes_extra_config(self, clientdir):
93         cfgfn = os.path.join(clientdir, "tahoe.cfg")
94         oldcfg = open(cfgfn, "r").read()
95
96Context:
97
98[docs: update docs/architecture.txt to more fully and correctly explain the upload procedure
99zooko@zooko.com**20100514043458
100 Ignore-this: 538b6ea256a49fed837500342092efa3
101]
102[Fix up the behavior of #778, per reviewers' comments
103Kevan Carstensen <kevan@isnotajoke.com>**20100514004917
104 Ignore-this: 9c20b60716125278b5456e8feb396bff
105 
106   - Make some important utility functions clearer and more thoroughly
107     documented.
108   - Assert in upload.servers_of_happiness that the buckets attributes
109     of PeerTrackers passed to it are mutually disjoint.
110   - Get rid of some silly non-Pythonisms that I didn't see when I first
111     wrote these patches.
112   - Make sure that should_add_server returns true when queried about a
113     shnum that it doesn't know about yet.
114   - Change Tahoe2PeerSelector.preexisting_shares to map a shareid to a set
115     of peerids, alter dependencies to deal with that.
116   - Remove upload.should_add_servers, because it is no longer necessary
117   - Move upload.shares_of_happiness and upload.shares_by_server to a utility
118     file.
119   - Change some points in Tahoe2PeerSelector.
120   - Compute servers_of_happiness using a bipartite matching algorithm that
121     we know is optimal instead of an ad-hoc greedy algorithm that isn't.
122   - Change servers_of_happiness to just take a sharemap as an argument,
123     change its callers to merge existing_shares and used_peers before
124     calling it.
125   - Change an error message in the encoder to be more appropriate for
126     servers of happiness.
127   - Clarify the wording of an error message in immutable/upload.py
128   - Refactor a happiness failure message to happinessutil.py, and make
129     immutable/upload.py and immutable/encode.py use it.
130   - Move the word "only" as far to the right as possible in failure
131     messages.
132   - Use a better definition of progress during peer selection.
133   - Do read-only peer share detection queries in parallel, not sequentially.
134   - Clean up logging semantics; print the query statistics whenever an
135     upload is unsuccessful, not just in one case.
136 
137]
138[Alter the error message when an upload fails, per some comments in #778.
139Kevan Carstensen <kevan@isnotajoke.com>**20091230210344
140 Ignore-this: ba97422b2f9737c46abeb828727beb1
141 
142 When I first implemented #778, I just altered the error messages to refer to
143 servers where they referred to shares. The resulting error messages weren't
144 very good. These are a bit better.
145]
146[Change "UploadHappinessError" to "UploadUnhappinessError"
147Kevan Carstensen <kevan@isnotajoke.com>**20091205043037
148 Ignore-this: 236b64ab19836854af4993bb5c1b221a
149]
150[Alter the error message returned when peer selection fails
151Kevan Carstensen <kevan@isnotajoke.com>**20091123002405
152 Ignore-this: b2a7dc163edcab8d9613bfd6907e5166
153 
154 The Tahoe2PeerSelector returned either NoSharesError or NotEnoughSharesError
155 for a variety of error conditions that weren't informatively described by them.
156 This patch creates a new error, UploadHappinessError, replaces uses of
157 NoSharesError and NotEnoughSharesError with it, and alters the error message
158 raised with the errors to be more in line with the new servers_of_happiness
159 behavior. See ticket #834 for more information.
160]
161[Eliminate overcounting iof servers_of_happiness in Tahoe2PeerSelector; also reorganize some things.
162Kevan Carstensen <kevan@isnotajoke.com>**20091118014542
163 Ignore-this: a6cb032cbff74f4f9d4238faebd99868
164]
165[Change stray "shares_of_happiness" to "servers_of_happiness"
166Kevan Carstensen <kevan@isnotajoke.com>**20091116212459
167 Ignore-this: 1c971ba8c3c4d2e7ba9f020577b28b73
168]
169[Alter Tahoe2PeerSelector to make sure that it recognizes existing shares on readonly servers, fixing an issue in #778
170Kevan Carstensen <kevan@isnotajoke.com>**20091116192805
171 Ignore-this: 15289f4d709e03851ed0587b286fd955
172]
173[Alter 'immutable/encode.py' and 'immutable/upload.py' to use servers_of_happiness instead of shares_of_happiness.
174Kevan Carstensen <kevan@isnotajoke.com>**20091104111222
175 Ignore-this: abb3283314820a8bbf9b5d0cbfbb57c8
176]
177[Alter the signature of set_shareholders in IEncoder to add a 'servermap' parameter, which gives IEncoders enough information to perform a sane check for servers_of_happiness.
178Kevan Carstensen <kevan@isnotajoke.com>**20091104033241
179 Ignore-this: b3a6649a8ac66431beca1026a31fed94
180]
181[Alter CiphertextDownloader to work with servers_of_happiness
182Kevan Carstensen <kevan@isnotajoke.com>**20090924041932
183 Ignore-this: e81edccf0308c2d3bedbc4cf217da197
184]
185[Revisions of the #778 tests, per reviewers' comments
186Kevan Carstensen <kevan@isnotajoke.com>**20100514012542
187 Ignore-this: 735bbc7f663dce633caeb3b66a53cf6e
188 
189 - Fix comments and confusing naming.
190 - Add tests for the new error messages suggested by David-Sarah
191   and Zooko.
192 - Alter existing tests for new error messages.
193 - Make sure that the tests continue to work with the trunk.
194 - Add a test for a mutual disjointedness assertion that I added to
195   upload.servers_of_happiness.
196 - Fix the comments to correctly reflect read-onlyness
197 - Add a test for an edge case in should_add_server
198 - Add an assertion to make sure that share redistribution works as it
199   should
200 - Alter tests to work with revised servers_of_happiness semantics
201 - Remove tests for should_add_server, since that function no longer exists.
202 - Alter tests to know about merge_peers, and to use it before calling
203   servers_of_happiness.
204 - Add tests for merge_peers.
205 - Add Zooko's puzzles to the tests.
206 - Edit encoding tests to expect the new kind of failure message.
207 - Edit tests to expect error messages with the word "only" moved as far
208   to the right as possible.
209 - Extended and cleaned up some helper functions.
210 - Changed some tests to call more appropriate helper functions.
211 - Added a test for the failing redistribution algorithm
212 - Added a test for the progress message
213 - Added a test for the upper bound on readonly peer share discovery.
214 
215]
216[Alter various unit tests to work with the new happy behavior
217Kevan Carstensen <kevan@isnotajoke.com>**20100107181325
218 Ignore-this: 132032bbf865e63a079f869b663be34a
219]
220[Replace "UploadHappinessError" with "UploadUnhappinessError" in tests.
221Kevan Carstensen <kevan@isnotajoke.com>**20091205043453
222 Ignore-this: 83f4bc50c697d21b5f4e2a4cd91862ca
223]
224[Add tests for the behavior described in #834.
225Kevan Carstensen <kevan@isnotajoke.com>**20091123012008
226 Ignore-this: d8e0aa0f3f7965ce9b5cea843c6d6f9f
227]
228[Re-work 'test_upload.py' to be more readable; add more tests for #778
229Kevan Carstensen <kevan@isnotajoke.com>**20091116192334
230 Ignore-this: 7e8565f92fe51dece5ae28daf442d659
231]
232[Test Tahoe2PeerSelector to make sure that it recognizeses existing shares on readonly servers
233Kevan Carstensen <kevan@isnotajoke.com>**20091109003735
234 Ignore-this: 12f9b4cff5752fca7ed32a6ebcff6446
235]
236[Add more tests for comment:53 in ticket #778
237Kevan Carstensen <kevan@isnotajoke.com>**20091104112849
238 Ignore-this: 3bb2edd299a944cc9586e14d5d83ec8c
239]
240[Add a test for upload.shares_by_server
241Kevan Carstensen <kevan@isnotajoke.com>**20091104111324
242 Ignore-this: f9802e82d6982a93e00f92e0b276f018
243]
244[Minor tweak to an existing test -- make the first server read-write, instead of read-only
245Kevan Carstensen <kevan@isnotajoke.com>**20091104034232
246 Ignore-this: a951a46c93f7f58dd44d93d8623b2aee
247]
248[Alter tests to use the new form of set_shareholders
249Kevan Carstensen <kevan@isnotajoke.com>**20091104033602
250 Ignore-this: 3deac11fc831618d11441317463ef830
251]
252[Refactor some behavior into a mixin, and add tests for the behavior described in #778
253"Kevan Carstensen" <kevan@isnotajoke.com>**20091030091908
254 Ignore-this: a6f9797057ca135579b249af3b2b66ac
255]
256[Alter NoNetworkGrid to allow the creation of readonly servers for testing purposes.
257Kevan Carstensen <kevan@isnotajoke.com>**20091018013013
258 Ignore-this: e12cd7c4ddeb65305c5a7e08df57c754
259]
260[Update 'docs/architecture.txt' to reflect readonly share discovery
261kevan@isnotajoke.com**20100514003852
262 Ignore-this: 7ead71b34df3b1ecfdcfd3cb2882e4f9
263]
264[Alter the wording in docs/architecture.txt to more accurately describe the servers_of_happiness behavior.
265Kevan Carstensen <kevan@isnotajoke.com>**20100428002455
266 Ignore-this: 6eff7fa756858a1c6f73728d989544cc
267]
268[Alter wording in 'interfaces.py' to be correct wrt #778
269"Kevan Carstensen" <kevan@isnotajoke.com>**20091205034005
270 Ignore-this: c9913c700ac14e7a63569458b06980e0
271]
272[Update 'docs/configuration.txt' to reflect the servers_of_happiness behavior.
273Kevan Carstensen <kevan@isnotajoke.com>**20091205033813
274 Ignore-this: 5e1cb171f8239bfb5b565d73c75ac2b8
275]
276[Clarify quickstart instructions for installing pywin32
277david-sarah@jacaranda.org**20100511180300
278 Ignore-this: d4668359673600d2acbc7cd8dd44b93c
279]
280[web: add a simple test that you can load directory.xhtml
281zooko@zooko.com**20100510063729
282 Ignore-this: e49b25fa3c67b3c7a56c8b1ae01bb463
283]
284[setup: fix typos in misc/show-tool-versions.py
285zooko@zooko.com**20100510063615
286 Ignore-this: 2181b1303a0e288e7a9ebd4c4855628
287]
288[setup: show code-coverage tool versions in show-tools-versions.py
289zooko@zooko.com**20100510062955
290 Ignore-this: 4b4c68eb3780b762c8dbbd22b39df7cf
291]
292[docs: update README, mv it to README.txt, update setup.py
293zooko@zooko.com**20100504094340
294 Ignore-this: 40e28ca36c299ea1fd12d3b91e5b421c
295]
296[Dependency on Windmill test framework is not needed yet.
297david-sarah@jacaranda.org**20100504161043
298 Ignore-this: be088712bec650d4ef24766c0026ebc8
299]
300[tests: pass z to tar so that BSD tar will know to ungzip
301zooko@zooko.com**20100504090628
302 Ignore-this: 1339e493f255e8fc0b01b70478f23a09
303]
304[setup: update comments and URLs in setup.cfg
305zooko@zooko.com**20100504061653
306 Ignore-this: f97692807c74bcab56d33100c899f829
307]
308[setup: reorder and extend the show-tool-versions script, the better to glean information about our new buildslaves
309zooko@zooko.com**20100504045643
310 Ignore-this: 836084b56b8d4ee8f1de1f4efb706d36
311]
312[CLI: Support for https url in option --node-url
313Francois Deppierraz <francois@ctrlaltdel.ch>**20100430185609
314 Ignore-this: 1717176b4d27c877e6bc67a944d9bf34
315 
316 This patch modifies the regular expression used for verifying of '--node-url'
317 parameter.  Support for accessing a Tahoe gateway over HTTPS was already
318 present, thanks to Python's urllib.
319 
320]
321[backupdb.did_create_directory: use REPLACE INTO, not INSERT INTO + ignore error
322Brian Warner <warner@lothar.com>**20100428050803
323 Ignore-this: 1fca7b8f364a21ae413be8767161e32f
324 
325 This handles the case where we upload a new tahoe directory for a
326 previously-processed local directory, possibly creating a new dircap (if the
327 metadata had changed). Now we replace the old dirhash->dircap record. The
328 previous behavior left the old record in place (with the old dircap and
329 timestamps), so we'd never stop creating new directories and never converge
330 on a null backup.
331]
332["tahoe webopen": add --info flag, to get ?t=info
333Brian Warner <warner@lothar.com>**20100424233003
334 Ignore-this: 126b0bb6db340fabacb623d295eb45fa
335 
336 Also fix some trailing whitespace.
337]
338[docs: install.html http-equiv refresh to quickstart.html
339zooko@zooko.com**20100421165708
340 Ignore-this: 52b4b619f9dde5886ae2cd7f1f3b734b
341]
342[docs: install.html -> quickstart.html
343zooko@zooko.com**20100421155757
344 Ignore-this: 6084e203909306bed93efb09d0e6181d
345 It is not called "installing" because that implies that it is going to change the configuration of your operating system. It is not called "building" because that implies that you need developer tools like a compiler. Also I added a stern warning against looking at the "InstallDetails" wiki page, which I have renamed to "AdvancedInstall".
346]
347[Fix another typo in tahoe_storagespace munin plugin
348david-sarah@jacaranda.org**20100416220935
349 Ignore-this: ad1f7aa66b554174f91dfb2b7a3ea5f3
350]
351[Add dependency on windmill >= 1.3
352david-sarah@jacaranda.org**20100416190404
353 Ignore-this: 4437a7a464e92d6c9012926b18676211
354]
355[licensing: phrase the OpenSSL-exemption in the vocabulary of copyright instead of computer technology, and replicate the exemption from the GPL to the TGPPL
356zooko@zooko.com**20100414232521
357 Ignore-this: a5494b2f582a295544c6cad3f245e91
358]
359[munin-tahoe_storagespace
360freestorm77@gmail.com**20100221203626
361 Ignore-this: 14d6d6a587afe1f8883152bf2e46b4aa
362 
363 Plugin configuration rename
364 
365]
366[setup: add licensing declaration for setuptools (noticed by the FSF compliance folks)
367zooko@zooko.com**20100309184415
368 Ignore-this: 2dfa7d812d65fec7c72ddbf0de609ccb
369]
370[setup: fix error in licensing declaration from Shawn Willden, as noted by the FSF compliance division
371zooko@zooko.com**20100309163736
372 Ignore-this: c0623d27e469799d86cabf67921a13f8
373]
374[CREDITS to Jacob Appelbaum
375zooko@zooko.com**20100304015616
376 Ignore-this: 70db493abbc23968fcc8db93f386ea54
377]
378[desert-island-build-with-proper-versions
379jacob@appelbaum.net**20100304013858]
380[docs: a few small edits to try to guide newcomers through the docs
381zooko@zooko.com**20100303231902
382 Ignore-this: a6aab44f5bf5ad97ea73e6976bc4042d
383 These edits were suggested by my watching over Jake Appelbaum's shoulder as he completely ignored/skipped/missed install.html and also as he decided that debian.txt wouldn't help him with basic installation. Then I threw in a few docs edits that have been sitting around in my sandbox asking to be committed for months.
384]
385[TAG allmydata-tahoe-1.6.1
386david-sarah@jacaranda.org**20100228062314
387 Ignore-this: eb5f03ada8ea953ee7780e7fe068539
388]
389Patch bundle hash:
3906dad762bdd420bef6ca0ece8e343528797b7d073