#1277 new defect

write a tool to copy all mutable shares onto a single or fewer disks

Reported by: davidsarah Owned by: davidsarah
Priority: major Milestone: soon
Component: code Version: 1.8.0
Keywords: mutable allmydata Cc:
Launchpad Bug:

Description

This could potentially help to retrieve the data of allmydata.com customers without having to put all of the disks online at once, by allowing us to build the directory tree. (All directories at that time will have been mutable.)

The tahoe debug dump-share command has code to determine whether a share is mutable.

Attachments (1)

copy_mutable_shares.py (2.3 KB) - added by davidsarah at 2010-12-12T01:40:01Z.
Script to copy mutable shares, with changes from kevan's review.

Download all attachments as: .zip

Change History (7)

comment:1 Changed at 2010-12-08T02:16:08Z by davidsarah

  • Keywords review-needed added

This has been rather cursorily tested and seems to work. It stops on any exception, which might not be what we want.

comment:2 Changed at 2010-12-08T17:58:42Z by kevan

  • Owner changed from somebody to kevan

I can review this.

comment:3 follow-up: Changed at 2010-12-11T21:18:24Z by kevan

When I write a utility script in Python (especially when its functionality is abstracted in a way that allows reuse), I prefer to stick the bits that rely on the script running as a standalone program in an

if __name__=="__main__":

block. This won't, AFAIK, change the way the script runs if you run it as a standalone program, but it will also allow you to import bits and pieces of the script from within other programs or the REPL; the latter, at least, can be very useful for debugging. Without something like that, this doesn't work:

viking-2:tahoe-1277 kacarstensen$ python
Python 2.6.1 (r261:67515, Dec  6 2008, 16:42:21) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from copy_mutable_shares import make_dirs
Usage: python copy_mutable_shares.py SRC_BASEDIR DEST_BASEDIR
viking-2:tahoe-1277 kacarstensen$ 

In your script, it's only the last four statements that need that. Just a thought.

The script executes without issue on my machine.

shortsi should be short_si to be consistent with your other variable names. I also think it is easier to read as short_si.

I don't have a strong opinion on how the script should handle exceptions, since I think there are good arguments for both what it does now and for other behaviors. Maybe we should get secorp to look at this ticket, and tell us what he (or his helpers) would want the script to do.

I've satisfied myself that your mutable file check is exhaustive, since the state of mutable.txt before the time that SDMF was finished suggests that there was only ever one mutable container version, which is the one you're checking for.

(The mutable.txt document says that the magic string should start with a lowercase t, which does not agree with the implementation. I guess the specification should be fixed at some point)

comment:4 Changed at 2010-12-11T21:18:52Z by kevan

  • Keywords review-needed removed
  • Owner changed from kevan to davidsarah

Changed at 2010-12-12T01:40:01Z by davidsarah

Script to copy mutable shares, with changes from kevan's review.

comment:5 in reply to: ↑ 3 Changed at 2010-12-12T01:53:15Z by davidsarah

Replying to kevan:

(The mutable.txt document says that the magic string should start with a lowercase t, which does not agree with the implementation. I guess the specification should be fixed at some point)

Fixed in 7da1885531508c25.

comment:6 Changed at 2021-03-30T18:41:12Z by meejah

  • Milestone changed from soon (release n/a) to soon

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.