[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3762: Determine what the new storage client HTTP protocol's version verb returns
Tahoe-LAFS
trac at tahoe-lafs.org
Mon Aug 16 20:28:10 UTC 2021
#3762: Determine what the new storage client HTTP protocol's version verb returns
--------------------------+-----------------------------------
Reporter: itamarst | Owner:
Type: task | Status: new
Priority: normal | Milestone: HTTP Storage Protocol
Component: unknown | Version: n/a
Resolution: | Keywords:
Launchpad Bug: |
--------------------------+-----------------------------------
Comment (by exarkun):
In my Haskell server, I modeled the Foolscap version response like this:
{{{
type ApplicationVersion = String
data Version1Parameters = Version1Parameters
{ maximumImmutableShareSize :: Size
, maximumMutableShareSize :: Size
, availableSpace :: Size
, toleratesImmutableReadOverrun :: Bool
, deleteMutableSharesWithZeroLengthWritev :: Bool
, fillsHolesWithZeroBytes :: Bool
, preventsReadPastEndOfShareData :: Bool
, httpProtocolAvailable :: Bool
} deriving (Show, Eq, Generic)
data Version = Version
{ applicationVersion :: ApplicationVersion
, parameters :: Version1Parameters
} deriving (Show, Eq, Generic)
}}}
I believe `httpProtocolAvailable` was an addition of my own and I think
that we may since have decided not to try to advertise GBS that way. I
think the rest of the fields correspond to what the current implementation
does.
It ends up being a lot more than just a "version". Oh well?
Most of these fields are really descriptions of behaviors of the storage
functionality of the server that might change (in practice I think only
`availableSpace` is particularly dynamic - all of the bools changed from
False to True or vice versa in some particular release and then never
again and the other sizes have some default that no one ever bothers to
override?). But there is that `ApplicationVersion` string.
Or, maybe more helpful is this fragment of Python that constructs the
value:
{{{
version = { b"http://allmydata.org/tahoe/protocols/storage/v1" :
{ b"maximum-immutable-share-size": remaining_space,
b"maximum-mutable-share-size":
MAX_MUTABLE_SHARE_SIZE,
b"available-space": remaining_space,
b"tolerates-immutable-read-overrun": True,
b"delete-mutable-shares-with-zero-length-writev":
True,
b"fills-holes-with-zero-bytes": True,
b"prevents-read-past-end-of-share-data": True,
},
b"application-version":
allmydata.__full_version__.encode("utf-8"),
}
}}}
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3762#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list