[tahoe-dev] immutable directories!

Brian Warner warner at lothar.com
Fri Nov 20 04:26:26 UTC 2009


Zooko Wilcox-O'Hearn wrote:
> Whoo-hoo!  Way to go Brian!  Immutable directories are in (#607)!   
> But is there a way for users to use them, such as through the CLI or  
> WUI?

So far the only user-level (non-webapi) access is via the "tahoe backup"
command, which now (see #828) creates immutable directories rather than
merely readonly ones. In particular, running "tahoe backup ~/source
alias:source-backups" a couple times creates a directory structure like
this:

 alias:source-backups/
  Latest (immutable dirnode)
  Archives/ (mutable writeable dirnode)
   TIMESTAMP1 (immutable dirnode)
   TIMESTAMP2 (immutable dirnode)
   ..

The new ticket #835 is about adding options to "tahoe cp" that let you
control whether the output directories are mutable or immutable, which
is the other way that I think users are likely to take advantage of
immutable directories.

I can't think of other obvious ways to create immutable directories. Can
you imagine any sort of WUI button for this? We don't have a "cp" or "cp
-r" button, and it isn't clear that you could provide one in a
one-directory-view-at-a-time WUI interface anyways. So I'm ok with
sticking to the CLI commands for now.

> Do the tests for #708 already cover everything that came out of the  
> #607 work?

Yup, I just finished manual testing. As you expected, a v1.5 WUI client
looking at a directory that contains an immutable directory shows a line
with the subdir name, a type of "?", and no hyperlink for traversal or
download. Very civilized.

A v1.5 CLI "tahoe ls" command shows the DIR2-CHK children of e.g. the
source-backups/ directory (in the example above) normally, but an
attempt to list that directory fails:

 % ./bin/tahoe ls alias:source-backups/Latest
 Error during GET: 400 Bad Request GET unknown: can only do t=info, not
t=json

(the key word in that error message is "unknown".. perhaps we should
improve the message to make it clear that we're looking at an
UnknownNode)

A v1.4 WUI client looking at a directory with DIR2-CHK in it gets a
TypeError exception, saying "unknown URI type: URI:DIR2-CHK". And the
v1.4 CLI "tahoe ls" produces an ugly HTMLified traceback to stderr.

> I guess the release notes will explain...

Yup, the NEWS file entry which introduces DIR2-CHK will explain what
older clients will see.

> Let us know how we can manually test the new immutable directories to  
> make sure they've been properly banged on in practice before a new  
> stable v1.6 release.  Of course, one of the best ways would be to use  
> #606 -- a super efficient and secure backup tool.  :-)  But that's  
> not done yet.  And we should bang on it in other ways, too.

Well, #828 is closed, so "tahoe backup" is creating immutable
directories. Using that a couple of times and then working with the
results (in particular I haven't tested "tahoe cp -r" of an immutable
dirnode) would be a great exercise.

(#606 is about making "tahoe backup" even faster, and I want to get it
done for 1.6, but is orthogonal to #828).

cheers,
 -Brian



More information about the tahoe-dev mailing list