#2521 closed defect (fixed)

magic-folder db schema changes

Reported by: dawuud Owned by: dawuud
Priority: normal Milestone: undecided
Component: code-frontend-magic-folder Version: 1.10.1
Keywords: magic-folder db schema Cc:
Launchpad Bug:

Description (last modified by daira)

We need to make the magic-folder db have a different schema; right now it's almost the same as the tahoe backup db schema... which is denormalized and uses several tables. Here instead we'll use just one table called local_files... it will contain version number, ancestor uri and ancestor timestamp but not the fileid field that tahoe backup was using.

Change History (7)

comment:1 Changed at 2015-10-12T02:39:30Z by daira

  • Component changed from unknown to code-frontend-magic-folder
  • Description modified (diff)
  • Owner changed from daira to dawuud

comment:2 Changed at 2015-10-12T18:11:57Z by dawuud

our latest progress is in this dev branch: https://github.com/david415/tahoe-lafs/tree/2521.magic-db-schema.1

This includes changes to the uploader, downloader and unit tests... so they all use the new magic-folder db schema. However currently the test_move_tree and test_alice_bob tests fail... and I think it's because I accidentally broke the uploader... not sure.

Last edited at 2015-10-12T19:59:36Z by daira (previous) (diff)

comment:3 follow-up: Changed at 2015-10-13T10:18:04Z by daira

I think we want to preserve unknown fields in the metadata when a file is uploaded over an existing file. (Remember that different clients of a magic folder collective may be using different versions of Tahoe, and we probably don't want the metadata written by a later version to be lost in that case. Actually, the best option would be to write a "magic_folder_schema_version" field, so that it is possible to tell which fields were deliberately written and which were just preserved.)

Nevertheless, LGTM, let's work on top of this commit.

comment:4 Changed at 2015-10-13T10:19:41Z by daira

We also need to update the design docs to reflect this change.

comment:5 in reply to: ↑ 3 Changed at 2015-10-13T10:48:34Z by daira

Replying to daira:

Remember that different clients of a magic folder collective may be using different versions of Tahoe, and we probably don't want the metadata written by a later version to be lost in that case.

Oh, that won't happen because the clients are each only writing to their own DMD. So a schema version field is probably overkill. Let's discuss whether unknown fields should be preserved in the pairing today.

comment:6 Changed at 2015-10-16T02:39:23Z by daira

The 2521.magic-db-schema.1 branch is passing tests now. It was necessary to fix some race conditions in the tests, and to implement directory creation.

comment:7 Changed at 2015-11-04T01:19:42Z by daira

  • Resolution set to fixed
  • Status changed from new to closed

The docs have been updated, so this is good to close.

Note: See TracTickets for help on using tickets.