Ticket #778: behavior.2.txt

File behavior.2.txt, 19.6 KB (added by kevan, at 2009-10-10T23:52:55Z)

The behavior discussed in this ticket

Line 
1Wed Sep 23 21:19:32 PDT 2009  Kevan Carstensen <kevan@isnotajoke.com>
2  * Alter CiphertextDownloader to work with servers_of_happiness
3
4Sat Oct 10 16:37:13 PDT 2009  Kevan Carstensen <kevan@isnotajoke.com>
5  * Alter 'immutable/encode.py' and 'immutable/upload.py' to use servers_of_happiness instead of shares_of_happiness.
6
7New patches:
8
9[Alter CiphertextDownloader to work with servers_of_happiness
10Kevan Carstensen <kevan@isnotajoke.com>**20090924041932
11 Ignore-this: e81edccf0308c2d3bedbc4cf217da197
12] hunk ./src/allmydata/immutable/download.py 996
13             # Repairer (uploader) needs the encodingparams.
14             self._target.set_encodingparams((
15                 self._verifycap.needed_shares,
16-                self._verifycap.total_shares, # I don't think the target actually cares about "happy".
17+                0, # see ticket #778 for why this is
18                 self._verifycap.total_shares,
19                 self._vup.segment_size
20                 ))
21[Alter 'immutable/encode.py' and 'immutable/upload.py' to use servers_of_happiness instead of shares_of_happiness.
22Kevan Carstensen <kevan@isnotajoke.com>**20091010233713
23 Ignore-this: 191f820168df6609d163eb60eeddc9ce
24] {
25hunk ./src/allmydata/immutable/encode.py 121
26         assert not self._codec
27         k, happy, n, segsize = params
28         self.required_shares = k
29-        self.shares_of_happiness = happy
30+        self.servers_of_happiness = happy
31         self.num_shares = n
32         self.segment_size = segsize
33         self.log("got encoding parameters: %d/%d/%d %d" % (k,happy,n, segsize))
34hunk ./src/allmydata/immutable/encode.py 179
35         if name == "storage_index":
36             return self._storage_index
37         elif name == "share_counts":
38-            return (self.required_shares, self.shares_of_happiness,
39+            return (self.required_shares, self.servers_of_happiness,
40                     self.num_shares)
41         elif name == "num_segments":
42             return self.num_segments
43hunk ./src/allmydata/immutable/encode.py 489
44             # even more UNUSUAL
45             self.log("they weren't in our list of landlords", parent=ln,
46                      level=log.WEIRD, umid="TQGFRw")
47-        if len(self.landlords) < self.shares_of_happiness:
48-            msg = "lost too many shareholders during upload (still have %d, want %d): %s" % \
49-                  (len(self.landlords), self.shares_of_happiness, why)
50+        if len(set(self.landlords)) < self.servers_of_happiness:
51+            msg = "lost too many servers during upload (still have %d, want %d): %s" % \
52+                  (len(set(self.landlords)), self.servers_of_happiness, why)
53             if self.landlords:
54                 raise NotEnoughSharesError(msg)
55             else:
56hunk ./src/allmydata/immutable/encode.py 497
57                 raise NoSharesError(msg)
58         self.log("but we can still continue with %s shares, we'll be happy "
59-                 "with at least %s" % (len(self.landlords),
60-                                       self.shares_of_happiness),
61+                 "with at least %s" % (len(set(self.landlords)),
62+                                       self.servers_of_happiness),
63                  parent=ln)
64 
65     def _gather_responses(self, dl):
66hunk ./src/allmydata/immutable/upload.py 147
67 
68     def get_shareholders(self, storage_broker, secret_holder,
69                          storage_index, share_size, block_size,
70-                         num_segments, total_shares, shares_of_happiness):
71+                         num_segments, total_shares, servers_of_happiness):
72         """
73         @return: (used_peers, already_peers), where used_peers is a set of
74                  PeerTracker instances that have agreed to hold some shares
75hunk ./src/allmydata/immutable/upload.py 160
76             self._status.set_status("Contacting Peers..")
77 
78         self.total_shares = total_shares
79-        self.shares_of_happiness = shares_of_happiness
80+        self.servers_of_happiness = servers_of_happiness
81 
82         self.homeless_shares = range(total_shares)
83         # self.uncontacted_peers = list() # peers we haven't asked yet
84hunk ./src/allmydata/immutable/upload.py 225
85         d = defer.maybeDeferred(self._loop)
86         return d
87 
88+    def _servers_with_shares(self):
89+        # return a set of peerids that will recieve shares from this upload,
90+        # based on the state of self.use_peers and self.prexisting_shares
91+        servers_with_shares = list(self.use_peers.copy())
92+        servers_with_shares.extend(self.preexisting_shares.values())
93+        servers_with_shares = set(servers_with_shares)
94+        return servers_with_shares
95+
96     def _loop(self):
97         if not self.homeless_shares:
98hunk ./src/allmydata/immutable/upload.py 235
99-            # all done
100-            msg = ("placed all %d shares, "
101-                   "sent %d queries to %d peers, "
102-                   "%d queries placed some shares, %d placed none, "
103-                   "got %d errors" %
104-                   (self.total_shares,
105-                    self.query_count, self.num_peers_contacted,
106-                    self.good_query_count, self.bad_query_count,
107-                    self.error_count))
108-            log.msg("peer selection successful for %s: %s" % (self, msg),
109+            servers_with_shares = self._servers_with_shares()
110+            if self.servers_of_happiness <= len(servers_with_shares):
111+                msg = ("placed all %d shares, "
112+                       "sent %d queries to %d peers, "
113+                       "%d queries placed some shares, %d placed none, "
114+                       "got %d errors" %
115+                       (self.total_shares,
116+                        self.query_count, self.num_peers_contacted,
117+                        self.good_query_count, self.bad_query_count,
118+                        self.error_count))
119+                log.msg("peer selection successful for %s: %s" % (self, msg),
120                     parent=self._log_parent)
121hunk ./src/allmydata/immutable/upload.py 247
122-            return (self.use_peers, self.preexisting_shares)
123+                return (self.use_peers, self.preexisting_shares)
124+            else:
125+                # we didn't place shares on enough distinct servers. fail.
126+                raise NotEnoughSharesError("shares could only be placed on %d "
127+                                           "servers (%d were requested)" %
128+                                           (len(servers_with_shares),
129+                                            self.servers_of_happiness))
130 
131         if self.uncontacted_peers:
132             peer = self.uncontacted_peers.pop(0)
133hunk ./src/allmydata/immutable/upload.py 302
134         else:
135             # no more peers. If we haven't placed enough shares, we fail.
136             placed_shares = self.total_shares - len(self.homeless_shares)
137-            if placed_shares < self.shares_of_happiness:
138+            servers_with_shares = self._servers_with_shares()
139+            if len(servers_with_shares) < self.servers_of_happiness:
140                 msg = ("placed %d shares out of %d total (%d homeless), "
141                        "want to place %d, "
142                        "sent %d queries to %d peers, "
143hunk ./src/allmydata/immutable/upload.py 311
144                        "got %d errors" %
145                        (self.total_shares - len(self.homeless_shares),
146                         self.total_shares, len(self.homeless_shares),
147-                        self.shares_of_happiness,
148+                        self.servers_of_happiness,
149                         self.query_count, self.num_peers_contacted,
150                         self.good_query_count, self.bad_query_count,
151                         self.error_count))
152replace ./src/allmydata/immutable/upload.py [A-Za-z_0-9] _servers_with_shares _servers_with_unique_shares
153replace ./src/allmydata/immutable/upload.py [A-Za-z_0-9] servers_with_shares servers_with_unique_shares
154}
155
156Context:
157
158[webapi.txt: document t=set_children, other small edits
159Brian Warner <warner@lothar.com>**20091009200446
160 Ignore-this: 4d7e76b04a7b8eaa0a981879f778ea5d
161]
162[Verifier: check the full cryptext-hash tree on each share. Removed .todos
163Brian Warner <warner@lothar.com>**20091005221849
164 Ignore-this: 6fb039c5584812017d91725e687323a5
165 from the last few test_repairer tests that were waiting on this.
166]
167[Verifier: check the full block-hash-tree on each share
168Brian Warner <warner@lothar.com>**20091005214844
169 Ignore-this: 3f7ccf6d253f32340f1bf1da27803eee
170 
171 Removed the .todo from two test_repairer tests that check this. The only
172 remaining .todos are on the three crypttext-hash-tree tests.
173]
174[Verifier: check the full share-hash chain on each share
175Brian Warner <warner@lothar.com>**20091005213443
176 Ignore-this: 3d30111904158bec06a4eac22fd39d17
177 
178 Removed the .todo from two test_repairer tests that check this.
179]
180[test_repairer: rename Verifier test cases to be more precise and less verbose
181Brian Warner <warner@lothar.com>**20091005201115
182 Ignore-this: 64be7094e33338c7c2aea9387e138771
183]
184[immutable/checker.py: rearrange code a little bit, make it easier to follow
185Brian Warner <warner@lothar.com>**20091005200252
186 Ignore-this: 91cc303fab66faf717433a709f785fb5
187]
188[test/common.py: wrap docstrings to 80cols so I can read them more easily
189Brian Warner <warner@lothar.com>**20091005200143
190 Ignore-this: b180a3a0235cbe309c87bd5e873cbbb3
191]
192[immutable/download.py: wrap to 80cols, no functional changes
193Brian Warner <warner@lothar.com>**20091005192542
194 Ignore-this: 6b05fe3dc6d78832323e708b9e6a1fe
195]
196[CHK-hashes.svg: cross out plaintext hashes, since we don't include
197Brian Warner <warner@lothar.com>**20091005010803
198 Ignore-this: bea2e953b65ec7359363aa20de8cb603
199 them (until we finish #453)
200]
201[docs: a few licensing clarifications requested by Ubuntu
202zooko@zooko.com**20090927033226
203 Ignore-this: 749fc8c9aeb6dc643669854a3e81baa7
204]
205[setup: remove binary WinFUSE modules
206zooko@zooko.com**20090924211436
207 Ignore-this: 8aefc571d2ae22b9405fc650f2c2062
208 I would prefer to have just source code, or indications of what 3rd-party packages are required, under revision control, and have the build process generate o
209 r acquire the binaries as needed.  Also, having these in our release tarballs is interfering with getting Tahoe-LAFS uploaded into Ubuntu Karmic.  (Technicall
210 y, they would accept binary modules as long as they came with the accompanying source so that they could satisfy their obligations under GPL2+ and TGPPL1+, bu
211 t it is easier for now to remove the binaries from the source tree.)
212 In this case, the binaries are from the tahoe-w32-client project: http://allmydata.org/trac/tahoe-w32-client , from which you can also get the source.
213]
214[setup: remove binary _fusemodule.so 's
215zooko@zooko.com**20090924211130
216 Ignore-this: 74487bbe27d280762ac5dd5f51e24186
217 I would prefer to have just source code, or indications of what 3rd-party packages are required, under revision control, and have the build process generate or acquire the binaries as needed.  Also, having these in our release tarballs is interfering with getting Tahoe-LAFS uploaded into Ubuntu Karmic.  (Technically, they would accept binary modules as long as they came with the accompanying source so that they could satisfy their obligations under GPL2+ and TGPPL1+, but it is easier for now to remove the binaries from the source tree.)
218 In this case, these modules come from the MacFUSE project: http://code.google.com/p/macfuse/
219]
220[doc: add a copy of LGPL2 for documentation purposes for ubuntu
221zooko@zooko.com**20090924054218
222 Ignore-this: 6a073b48678a7c84dc4fbcef9292ab5b
223]
224[setup: remove a convenience copy of figleaf, to ease inclusion into Ubuntu Karmic Koala
225zooko@zooko.com**20090924053215
226 Ignore-this: a0b0c990d6e2ee65c53a24391365ac8d
227 We need to carefully document the licence of figleaf in order to get Tahoe-LAFS into Ubuntu Karmic Koala.  However, figleaf isn't really a part of Tahoe-LAFS per se -- this is just a "convenience copy" of a development tool.  The quickest way to make Tahoe-LAFS acceptable for Karmic then, is to remove figleaf from the Tahoe-LAFS tarball itself.  People who want to run figleaf on Tahoe-LAFS (as everyone should want) can install figleaf themselves.  I haven't tested this -- there may be incompatibilities between upstream figleaf and the copy that we had here...
228]
229[setup: shebang for misc/build-deb.py to fail quickly
230zooko@zooko.com**20090819135626
231 Ignore-this: 5a1b893234d2d0bb7b7346e84b0a6b4d
232 Without this patch, when I ran "chmod +x ./misc/build-deb.py && ./misc/build-deb.py" then it hung indefinitely.  (I wonder what it was doing.)
233]
234[docs: Shawn Willden grants permission for his contributions under GPL2+|TGPPL1+
235zooko@zooko.com**20090921164651
236 Ignore-this: ef1912010d07ff2ffd9678e7abfd0d57
237]
238[docs: Csaba Henk granted permission to license fuse.py under the same terms as Tahoe-LAFS itself
239zooko@zooko.com**20090921154659
240 Ignore-this: c61ba48dcb7206a89a57ca18a0450c53
241]
242[setup: mark setup.py as having utf-8 encoding in it
243zooko@zooko.com**20090920180343
244 Ignore-this: 9d3850733700a44ba7291e9c5e36bb91
245]
246[doc: licensing cleanups
247zooko@zooko.com**20090920171631
248 Ignore-this: 7654f2854bf3c13e6f4d4597633a6630
249 Use nice utf-8 © instead of "(c)". Remove licensing statements on utility modules that have been assigned to allmydata.com by their original authors. (Nattraverso was not assigned to allmydata.com -- it was LGPL'ed -- but I checked and src/allmydata/util/iputil.py was completely rewritten and doesn't contain any line of code from nattraverso.)  Add notes to misc/debian/copyright about licensing on files that aren't just allmydata.com-licensed.
250]
251[build-deb.py: run darcsver early, otherwise we get the wrong version later on
252Brian Warner <warner@lothar.com>**20090918033620
253 Ignore-this: 6635c5b85e84f8aed0d8390490c5392a
254]
255[new approach for debian packaging, sharing pieces across distributions. Still experimental, still only works for sid.
256warner@lothar.com**20090818190527
257 Ignore-this: a75eb63db9106b3269badbfcdd7f5ce1
258]
259[new experimental deb-packaging rules. Only works for sid so far.
260Brian Warner <warner@lothar.com>**20090818014052
261 Ignore-this: 3a26ad188668098f8f3cc10a7c0c2f27
262]
263[setup.py: read _version.py and pass to setup(version=), so more commands work
264Brian Warner <warner@lothar.com>**20090818010057
265 Ignore-this: b290eb50216938e19f72db211f82147e
266 like "setup.py --version" and "setup.py --fullname"
267]
268[test/check_speed.py: fix shbang line
269Brian Warner <warner@lothar.com>**20090818005948
270 Ignore-this: 7f3a37caf349c4c4de704d0feb561f8d
271]
272[setup: remove bundled version of darcsver-1.2.1
273zooko@zooko.com**20090816233432
274 Ignore-this: 5357f26d2803db2d39159125dddb963a
275 That version of darcsver emits a scary error message when the darcs executable or the _darcs subdirectory is not found.
276 This error is hidden (unless the --loud option is passed) in darcsver >= 1.3.1.
277 Fixes #788.
278]
279[de-Service-ify Helper, pass in storage_broker and secret_holder directly.
280Brian Warner <warner@lothar.com>**20090815201737
281 Ignore-this: 86b8ac0f90f77a1036cd604dd1304d8b
282 This makes it more obvious that the Helper currently generates leases with
283 the Helper's own secrets, rather than getting values from the client, which
284 is arguably a bug that will likely be resolved with the Accounting project.
285]
286[immutable.Downloader: pass StorageBroker to constructor, stop being a Service
287Brian Warner <warner@lothar.com>**20090815192543
288 Ignore-this: af5ab12dbf75377640a670c689838479
289 child of the client, access with client.downloader instead of
290 client.getServiceNamed("downloader"). The single "Downloader" instance is
291 scheduled for demolition anyways, to be replaced by individual
292 filenode.download calls.
293]
294[tests: double the timeout on test_runner.RunNode.test_introducer since feisty hit a timeout
295zooko@zooko.com**20090815160512
296 Ignore-this: ca7358bce4bdabe8eea75dedc39c0e67
297 I'm not sure if this is an actual timing issue (feisty is running on an overloaded VM if I recall correctly), or it there is a deeper bug.
298]
299[stop making History be a Service, it wasn't necessary
300Brian Warner <warner@lothar.com>**20090815114415
301 Ignore-this: b60449231557f1934a751c7effa93cfe
302]
303[Overhaul IFilesystemNode handling, to simplify tests and use POLA internally.
304Brian Warner <warner@lothar.com>**20090815112846
305 Ignore-this: 1db1b9c149a60a310228aba04c5c8e5f
306 
307 * stop using IURI as an adapter
308 * pass cap strings around instead of URI instances
309 * move filenode/dirnode creation duties from Client to new NodeMaker class
310 * move other Client duties to KeyGenerator, SecretHolder, History classes
311 * stop passing Client reference to dirnode/filenode constructors
312   - pass less-powerful references instead, like StorageBroker or Uploader
313 * always create DirectoryNodes by wrapping a filenode (mutable for now)
314 * remove some specialized mock classes from unit tests
315 
316 Detailed list of changes (done one at a time, then merged together)
317 
318 always pass a string to create_node_from_uri(), not an IURI instance
319 always pass a string to IFilesystemNode constructors, not an IURI instance
320 stop using IURI() as an adapter, switch on cap prefix in create_node_from_uri()
321 client.py: move SecretHolder code out to a separate class
322 test_web.py: hush pyflakes
323 client.py: move NodeMaker functionality out into a separate object
324 LiteralFileNode: stop storing a Client reference
325 immutable Checker: remove Client reference, it only needs a SecretHolder
326 immutable Upload: remove Client reference, leave SecretHolder and StorageBroker
327 immutable Repairer: replace Client reference with StorageBroker and SecretHolder
328 immutable FileNode: remove Client reference
329 mutable.Publish: stop passing Client
330 mutable.ServermapUpdater: get StorageBroker in constructor, not by peeking into Client reference
331 MutableChecker: reference StorageBroker and History directly, not through Client
332 mutable.FileNode: removed unused indirection to checker classes
333 mutable.FileNode: remove Client reference
334 client.py: move RSA key generation into a separate class, so it can be passed to the nodemaker
335 move create_mutable_file() into NodeMaker
336 test_dirnode.py: stop using FakeClient mockups, use NoNetworkGrid instead. This simplifies the code, but takes longer to run (17s instead of 6s). This should come down later when other cleanups make it possible to use simpler (non-RSA) fake mutable files for dirnode tests.
337 test_mutable.py: clean up basedir names
338 client.py: move create_empty_dirnode() into NodeMaker
339 dirnode.py: get rid of DirectoryNode.create
340 remove DirectoryNode.init_from_uri, refactor NodeMaker for customization, simplify test_web's mock Client to match
341 stop passing Client to DirectoryNode, make DirectoryNode.create_with_mutablefile the normal DirectoryNode constructor, start removing client from NodeMaker
342 remove Client from NodeMaker
343 move helper status into History, pass History to web.Status instead of Client
344 test_mutable.py: fix minor typo
345]
346[docs: edits for docs/running.html from Sam Mason
347zooko@zooko.com**20090809201416
348 Ignore-this: 2207e80449943ebd4ed50cea57c43143
349]
350[docs: install.html: instruct Debian users to use this document and not to go find the DownloadDebianPackages page, ignore the warning at the top of it, and try it
351zooko@zooko.com**20090804123840
352 Ignore-this: 49da654f19d377ffc5a1eff0c820e026
353 http://allmydata.org/pipermail/tahoe-dev/2009-August/002507.html
354]
355[docs: relnotes.txt: reflow to 63 chars wide because google groups and some web forms seem to wrap to that
356zooko@zooko.com**20090802135016
357 Ignore-this: 53b1493a0491bc30fb2935fad283caeb
358]
359[docs: about.html: fix English usage noticed by Amber
360zooko@zooko.com**20090802050533
361 Ignore-this: 89965c4650f9bd100a615c401181a956
362]
363[docs: fix mis-spelled word in about.html
364zooko@zooko.com**20090802050320
365 Ignore-this: fdfd0397bc7cef9edfde425dddeb67e5
366]
367[TAG allmydata-tahoe-1.5.0
368zooko@zooko.com**20090802031303
369 Ignore-this: 94e5558e7225c39a86aae666ea00f166
370]
371Patch bundle hash:
372003e9c916ad1e12a72122f96cb8b77d73487afa0