[tahoe-lafs-trac-stream] [tahoe-lafs] #1382: immutable peer selection refactoring and enhancements
tahoe-lafs
trac at tahoe-lafs.org
Tue Dec 31 17:37:57 UTC 2013
#1382: immutable peer selection refactoring and enhancements
-------------------------+-------------------------------------------------
Reporter: kevan | Owner: markberger
Type: | Status: new
enhancement | Milestone: 1.11.0
Priority: major | Version: 1.8.2
Component: code- | Keywords: review-needed servers-of-happiness
peerselection | blocks-release
Resolution: |
Launchpad Bug: |
-------------------------+-------------------------------------------------
Comment (by daira):
Replying to [comment:62 zooko]:
> So I suspect that is_happy_enough() isn't calculating exactly the right
function, but we don't notice because it gets called only for well-
distributed things, by test_upload, so "return True" also works for the
current tests. (I tried this, and {{{return True}}} does indeed give the
correct answer for all queries that test_upload.py sends to the
{{{is_happy_enough}}} function.)
> But it seems like we ought to replace it with a function that calculates
the correct thing, to avoid confusing future test-writers.
>
> So Mark: please write a new {{{is_happy_enough}}}, or explain to me why
I'm wrong, or replace the call to {{{is_happy_enough}}} with a call to
{{{allmydata.util.happinessutil.servers_of_happiness}}}.
Calling {{{allmydata.util.happinessutil.servers_of_happiness}}} from
{{{is_happy_enough}}} and trusting the result would not preserve the
intent of the test, because there might be a bug in {{{happinessutil}}}
that would then propagate to the test and result in a false pass.
Since the test only checks for happiness rather than unhappiness, it would
be possible to call a function in {{{servers_of_happiness}}} that returns
a purported maximum matching, and check that it actually is a matching. It
is not necessary to check that the matching is maximum, because not being
maximum could only cause the test to fail; it could not cause a false
pass.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1382#comment:65>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list