Kevan [Sat, 14 Jan 2012 21:58:08 +0000 (13:58 -0800)]
Add _get_next_allocation method; remove duplicated logic from _loop.
This is essentially a copy-and-paste of tracker and share selection
logic from within _loop to _get_next_allocation. Now,
_get_next_allocation is responsible for telling _loop what to do (i.e.,
which server to use, and which shares to store on that server), and
_loop is responsible for doing what _get_next_allocation says to do.
This isn't a big change right now, but allows us to move to an external
peer selector object more easily (and obviously) in the future.
This also unifies the log messages for success and failure, and the
exception messages printed on a failure. Before, users would see two
slightly different messages depending on where in _loop the allocation
was noted as successful (or unsuccessful). This commit chooses the more
verbose form of these messages to be used on all successes and failures.
Kevan [Sat, 14 Jan 2012 20:57:06 +0000 (12:57 -0800)]
Add _do_inquiry method; rework readonly check to use _do_inquiry.
do_inquiry contacts a storage server (through its tracker instance)
asking about existing shares, recording any that it finds to our
internal state. In the current codebase, this will be used for the
readonly check, but we'll be able to use it later to handle the inquiry
tasks given to us by the peer selector.
Kevan [Sat, 14 Jan 2012 20:11:22 +0000 (12:11 -0800)]
Add IPeerSelector interface from #1382, modified slightly.
Instead of dealing with only share assignments, we'll think of the peer
selector as dealing with tasks. It can ask its caller to inquire about
the state of the grid, and to place shares. I'm not sure if there's a
use case for other types of inquiry, or if we need to support them. Peer
selection is complete when there are no more tasks.
Brian Warner [Wed, 24 Apr 2013 23:56:29 +0000 (16:56 -0700)]
NEWS: improve highlighting
It looks like github's ReST renderer shows ''' with more emphasis than
---, so use ''' for release names, and --- for groups of changes within
a given release.
Brian Warner [Sun, 14 Apr 2013 21:03:34 +0000 (14:03 -0700)]
client.py: remove the old "server.privkey" fallback
For a brief while (in between releases 1.9 and 1.10, specifically from
revision bc21726 on 12-Mar-2012, until bf416af on 10-Jun-2012), the new
introducer code stored its node key in NODEDIR/private/server.privkey .
After that point, it was updated to store this key in
NODEDIR/private/node.privkey instead. Fallback code was added to read
from the old location if present (so that folks using development
versions could keep their node keys after the bf416af change).
This patch removes the fallback code. If you have a node which was run
under a version of Tahoe within this range, you need to manually update
your node by running:
and then restart the node. If you accidentally start an older node with
code after this patch, it will create a new key (and other peers will
think a new server has appeared). You can either stick with the new key,
or use the command above to switch back to the old key.
See docs/nodekeys.rst (not yet written) for details about the node key
and how it is used.
Brian Warner [Mon, 18 Jun 2012 17:43:49 +0000 (10:43 -0700)]
bin/tahoe: clean up global-vs-subcommand arguments like --node-directory
The new rules for "bin/tahoe ARG1.. SUBCOMMAND ARG2.." arg:
* --node-directory is only accepted in ARG1, not ARG2
* create-*/start/stop/restart accept --basedir in ARG2, or an explicit
basedir argument
* only one of --node-directory/--basedir/explicit-basedir is accepted
* --quiet/--version is only accepted in ARG1, not ARG2
Brian Warner [Wed, 27 Mar 2013 23:43:36 +0000 (16:43 -0700)]
NEWS: add unsorted recent entries. I think that's all of them.
This list includes the changes made between 1.9.0 and the 1.9.2 darcs
release. There are also lots of non-user-visible changes, but NEWS
doesn't need to include them.
Brian Warner [Tue, 26 Mar 2013 00:57:01 +0000 (17:57 -0700)]
resurrect provisioning.py
It looks like commit 916d26e7103208fa207259d62ce453a5a8b9acd0, in
addition to making a one-line fix for #1681, also deleted
misc/operations_helpers/provisioning/provisioning.py entirely. This
brings it back.
Brian Warner [Wed, 20 Mar 2013 22:25:10 +0000 (15:25 -0700)]
client.py: throw error when reserved_space= is unparseable. Closes #1812.
This should now fail quickly (during "tahoe start"). Previously this
would silently treat an unparseable size as "0", and the only way to
discover that it had had a problem would be to look at the foolscap log,
or examine the storage-service web page for the unexpected "Reserved
Size" number.
Brian Warner [Wed, 20 Mar 2013 22:10:47 +0000 (15:10 -0700)]
Make introducer.furl unguessable. Closes #1802.
Previously, Introducers always used a swissnum of "introducer", so
anyone who could learn the (public) tubid of the introducer would be
able to connect to and use it. This changes new Introducers to use the
same randomly-generated swissnum as clients and storage servers do, so
that you absolutely must learn the introducer.furl from someone who
knows it already before you can connect.
This change also moves the location of the file that stores
introducer.furl from BASEDIR/introducer.furl to
BASEDIR/private/introducer.furl, since that's where we keep the private
things. The first time an introducer is started with the new code, it
will move any existing BASEDIR/introducer.furl into the new place.
Note that this will not change the FURL of existing introducers: it will
only affect newly created ones. When you change an introducer's FURL,
you must also update all of the nodes (clients and storage servers)
which connect to it, so upgrading it to an unguessable one isn't
something we should do automatically.
Brian Warner [Tue, 19 Mar 2013 00:40:56 +0000 (17:40 -0700)]
introducer.client: use integer seqnums, not time-based. Closes #1767.
This stores the sequence number in BASEDIR/announcement-seqnum, and
increments it each time any service is published (every service
announcement is regenerated with the new sequence number). As everyone
knows, time is an illusion, and occasionally goes backwards, so a
counter is generally safer (and reveals less information about the
node).
Later, we'll improve the introducer client to tolerate rollbacks (where,
perhaps due to a VM being restarted from an earlier checkpoint, the
stored sequence number reverts to an earlier version).
Brian Warner [Tue, 19 Mar 2013 00:30:57 +0000 (17:30 -0700)]
fileutil.write: accept mode=, and use it in Node.write_config
I want mode="w" (i.e. text, with newline conversion) for code that
writes newline-terminated strings (which should also be human readable)
to files. I like to use things like "cat .tahoe/permutation-seed"
without seeing the seed jammed together with the next command prompt.
Mike Kazantsev [Wed, 27 Feb 2013 17:14:58 +0000 (23:14 +0600)]
test_web.py: fix test_GET_DIRECTORY_html_filenode_encoding for Twisted==12.3.0. fixes #1922
twisted.web.html.escape was used to produce html-encoded string (to then look
it up in "value" attribute), but behavior of that function has changed between
Twisted 12.2.0 (simple custom implementation) and 12.3.0 (imported from stdlib
cgi module).
tahoe_check.py: tolerate missing fields in check results for LIT files/dirs. fixes #1758
Also test this case and improve some existing tests of 'tahoe check'.