More immutable support for HTTP storage API #1178
No reviewers
Labels
No Label
Benchmarking and Performance
HTTP Storage Protocol
Nevow Removal
Python 3 Porting
not-for-merge
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tahoe-lafs/tahoe-lafs#1178
Loading…
Reference in New Issue
No description provided.
Delete Branch "3860-http-more-immutables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3860
I decided to limit the scope of the spec in a few places in order to simplify the implementation.
Coverage increased (+0.06%) to 94.613% when pulling
87ab56426a
on 3860-http-more-immutables into2444c55b36
on master.Thanks! Looks good. A few minor comments inline. Please address and merge.
Typo = "Mape"
I'm not sure what the consequences are, but the regex will match some strings that
si_a2b
will reject. For example,nomd2a65ylxjbqzsw7gcfh4ivr
orh3q2wnkd4slieprxomfbczu7g6
.I guess this just means
to_python
should handle the exception and turn it into aValidationError
.@ -246,0 +262,4 @@
try:
finished = bucket.write(offset, data)
except ConflictingWriteError:
request.setResponseCode(http.CONFLICT)
Nice.
@ -295,2 +332,4 @@
# https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3872
data = bucket.read(offset, end - offset)
request.setResponseCode(http.PARTIAL_CONTENT)
Also, in practice, share number cannot be greater than 255 because zfec only supports 256 shares and is zero-indexed. However, I'm not sure there's any reason a storage server should know or care about that - perhaps the client is eventually upgraded to support another encoding scheme without that limitation. So ... just fyi.
@ -1130,7 +1140,7 @@ class _HTTPStorageServer(object):
client=immutable_client,
storage_index=storage_index,
share_number=share_num,
This key creates a link between multiple upload actions taken by a single client. Currently a client could be configured to use Tor or I2P and probably avoid the creation of such a link.
We've already discussed other strategies for determining an upload key so I expect that this approach is just a step on the path towards that goal, which is fine. Maybe at this point it's worth having a ticket for the ultimate goal and linking to it here.
im_...
first made me think of "instance method". Tahoe uses "imm" as an abbreviation for "immutable" in some places already, maybe that would be a better component for this name.though now I see this is an existing name that just got shuffled around a little bit, so not a blocker for this PR if you don't want
@ -409,3 +524,3 @@
im_client.write_share_chunk(
self.imm_client.write_share_chunk(
storage_index,
share_number,
I think this just moved around but this is the same as
bytes(range(16))
right?Did the coverage proposed by
test_bucket_allocated_with_new_shares
get added somewhere? Or did it prove to be redundant?The docstring and the test method name don't seem to agree here. The docstring looks more accurate to me - but I am not an expert at eyeball parsing byte ranges. Does this test coverage the negative offset and length cases? If not, it looks like those tests are missing.
(on further reading, I think
"bytes=-2-9"
is the negative offset case and"bytes=0--10"
is the negative length case, if so, cool)May as well fix it before I wrote more tests.
test_allocate_buckets_second_time_different_shares
covers this.@ -1130,7 +1140,7 @@ class _HTTPStorageServer(object):
client=immutable_client,
storage_index=storage_index,
share_number=share_num,
Hm. This is a... API mismatch, if I remember correctly. I will try to fix it now, if I can. If I can't I'll open a ticket with explanation of the problem.
@ -1130,7 +1140,7 @@ class _HTTPStorageServer(object):
client=immutable_client,
storage_index=storage_index,
share_number=share_num,
Might be fixable, but will require some logic changes in allocating buckets on HTTP side, potentially with other security implications, so I will merge this without that and do it as follow-up ticket so it's easier to review.