Opened at 2021-08-16T18:19:07Z
Closed at 2022-07-15T14:00:36Z
#3761 closed task (fixed)
Sketch of proposed GBS Python interface
Reported by: | itamarst | Owned by: | itamarst |
---|---|---|---|
Priority: | normal | Milestone: | HTTP Storage Protocol |
Component: | unknown | Version: | n/a |
Keywords: | Cc: | ||
Launchpad Bug: |
Description (last modified by itamarst)
In order to refactor the Tahoe-LAFS client code to support two protocols in parallel, we need some implementation of a new low-level client storage Python interface (let's call it IStorageClient). The production IStorageClient implementation will talk the GBS HTTP protocol to the storage server.
However, since the wire protocol is going to have to be audited, a useful first step would be a IStorageClient sketch that just demonstrates what a Python API might look like, and how it would integrate.
The deliverables for this will be:
- A new interface, IStorageClientV2, corresponding the the proposed HTTP protocol.
- Implement adapter from IStorageServer to IStorageClientV2. Might not be code that is tested or runs, but should at least suffice to demonstrate that this approach is viable.
Potential follow-ups:
- Update all existing users of IStorageServer to not presume Foolscap, so e.g. don't assume commands are executed in order sent.
- A compliance test suite for IStorageClientV2 providers.
- Maybe? A (verified) fake IStorageClientV2. Since it won't talk over the network, there is no need for a separate server.
Change History (13)
comment:1 Changed at 2021-08-16T19:45:49Z by itamarst
- Description modified (diff)
- Owner set to itamarst
- Summary changed from Fake client/server pair implementing proposed GBS Python interface to Fake client/server pair implementing proposed GBS Python interface (part 1: immutables)
comment:2 Changed at 2021-08-17T19:37:53Z by itamarst
comment:3 Changed at 2021-08-18T15:48:45Z by itamarst
After further thought: it seems like one could actually port Foolscap-based code to talk to an implementation of the interface that is just a facade using Foolscap behind the scenes. So giong to try this, because if that works and is easy, dropping in HTTP will be easy.
comment:4 Changed at 2021-08-19T20:09:18Z by itamarst
After further thought: is this just what IStorageServer already is? A Python-y wrapper around RIStorageServer, the Foolscap-specific interface.
comment:5 Changed at 2021-08-20T12:45:47Z by itamarst
IStorageServer is actually pretty close for immutables; will look at mutables next. So plausibly could make HTTP-based IStorageServer implementation and not change existing code.
There's a caveat though: the current implementation has Assumptions, namely that:
- Method calls happen _sequentially_, since it's all over the same TCP connection.
- Some method implementations are synchronous on the server(!!!).
So the real work may be:
- Going through the code and manually auditing it for places where these assumptions hold.
- Perhaps simulating arbitrary delays in messages to automatically find places in the code that make this assumption.
comment:6 Changed at 2021-08-20T13:36:30Z by itamarst
Another option is IStorageServer that is backed by HTTP and ensures calls are sequential with the same semantics as Foolscap. At a guess that would be a single persistent HTTP connection with pipelining (the latter being not strictly necessary, but important for performance).
comment:7 Changed at 2021-08-20T13:46:55Z by itamarst
Twisted doesn't have HTTP/1.1 pipelining anymore, and HTTP/2 is multiplexed, not pipelined, so can't rely on being sequential (Twisted support is unclear).
comment:8 Changed at 2021-08-20T15:27:36Z by itamarst
(Moved to #3779).
comment:9 Changed at 2021-08-23T15:36:19Z by itamarst
- Description modified (diff)
comment:10 Changed at 2021-08-25T16:43:54Z by itamarst
- Description modified (diff)
- Summary changed from Fake client/server pair implementing proposed GBS Python interface (part 1: immutables) to Sketch of proposed GBS Python interface
comment:11 Changed at 2021-08-25T16:52:27Z by itamarst
- Description modified (diff)
comment:12 Changed at 2021-08-25T17:01:35Z by itamarst
Decided that IStorageServer backed by HTTP is plausibly way to go, updated ticket description appropriately.
comment:13 Changed at 2022-07-15T14:00:36Z by itamarst
- Resolution set to fixed
- Status changed from new to closed
This has now been implemented for realsies.
Because lease logic is still being discussed, I decided to just stick to current structure with the presumption that because lease logic is fairly minimal and not used much, fixing it later won't be a big deal.