implement URI:LIT encoding for very small files #81

Closed
opened 2007-07-08 15:48:34 +00:00 by warner · 5 comments

Uploading a zero-length file causes a divide-by-zero error, because segment_size ends up being zero.

It would probably be sufficient to simply make segment_size always be at least one.

Uploading a zero-length file causes a divide-by-zero error, because segment_size ends up being zero. It would probably be sufficient to simply make segment_size always be at least one.
warner added the
code
major
defect
0.4.0
labels 2007-07-08 15:48:34 +00:00
warner added this to the 0.5.0 milestone 2007-07-08 15:48:34 +00:00
Author

upgrading priority because I really want this one fixed before the 0.5.0 release. Once the new webapi is in place and it is easy to upload a lot of files at once, this bug becomes a lot more annoying.

upgrading priority because I really want this one fixed before the 0.5.0 release. Once the new webapi is in place and it is easy to upload a lot of files at once, this bug becomes a lot more annoying.
warner added
critical
and removed
major
labels 2007-07-11 22:31:43 +00:00
Author

we're going to fix this one by implementing URI:LIT uris, which are used for very small files (less than about 40 bytes), in which the entire file contents are contained verbatim inside the URI itself.

we're going to fix this one by implementing URI:LIT uris, which are used for very small files (less than about 40 bytes), in which the entire file contents are contained verbatim inside the URI itself.
warner changed title from uploading an empty file causes an exception to implement URI:LIT encoding for very small files 2007-07-12 17:58:53 +00:00
Author

Our target for CHK URIs is URI:CHK:(base32(16byte AES key)):(base32(32byte URI Extension Hash)):needed_shares:total_shares:size

so that's 3+1+3+1+26+1+52+1+2+1+3+1+2 = 97 bytes (at least for <100B files).

Our plan for LIT uris is: URI:LIT:(base32(data))

So the breakeven point is 55 bytes. A 55 byte file will fit into a 3+1+3+1+88 = 96 byte LIT uri.

So if the file is 55 bytes or smaller, store it in a LIT, otherwise store it in the grid.

Our target for CHK URIs is URI:CHK:(base32(16byte AES key)):(base32(32byte URI Extension Hash)):needed_shares:total_shares:size so that's 3+1+3+1+26+1+52+1+2+1+3+1+2 = 97 bytes (at least for <100B files). Our plan for LIT uris is: URI:LIT:(base32(data)) So the breakeven point is 55 bytes. A 55 byte file will fit into a 3+1+3+1+88 = 96 byte LIT uri. So if the file is 55 bytes or smaller, store it in a LIT, otherwise store it in the grid.
Author

Oh, and of course this also includes 0-byte files, which neatly fixes the problem of the encoding algorithm exploding when faced with 0-byte files.

Oh, and of course this also includes 0-byte files, which neatly fixes the problem of the encoding algorithm exploding when faced with 0-byte files.
Author

done, plus tests.

done, plus tests.
warner added the
fixed
label 2007-07-12 20:25:39 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#81
No description provided.