Allow largefiles to be at a different location - Implementation details

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Mon May 23 20:52:43 UTC 2016


There are several ways to implement getting large files from different
location and no matter which solution is chosen there is a problem when
client uses hg that doesn't support new feature to connect to repository
with this feature enabled. I would like to know which of the following
solutions you find best or do you have any comments etc:

1.  Idea

Assumptions:
*  proto.statlfile returns location
*  proto.getlfile returns length+file only if available on server, if file
on different location then it throws error
*  store._verifyfiles checks file by downloading it from appropriate
location and checking it locally on client
*  store._getfile get location from proto.statlfile, if file is available
on server than call  proto.getlfile, in other case download from location
returned by proto.statlfile(question is how to know length of file to
include it at the beggining of the stream - saved it with file on different
location?)

Old Hg on Client, New Hg on Server:
* store._verifyfiles fails because proto.statlfile returns location instead
of number
* store._getfile fails if file not available on server

2. Idea

Assumptions:
* proto.statlfile returns size of file(for now i have no idea how it can
know what size is)
* proto.getlfile returns only file (without file length) if available on
server, if file is on different location then it redirects connection to
that remote location
* proto.getlfile doesnt include length of file at the beggining of the
stream
* store._verifyfiles checks by downloading the file and doing checks
locally on client
* store._getfile just download the file using proto.getlfile with length
given by proto.statlfile

Old HG on Client, New Hg on Server:
* store._verifyfiles fails if proto.statlfile returns size of file > 2, in
other case shows bad result
* store._getfile fails because it needs length at the beggining of the
stream

3. Idea

Assumptions
* proto.statlfile returns stat of file as usual
* proto.getlfile returns length+file if available, if file on different
location throws error
* new wireproto command ,proto.getlfilelocation returns location of file
* once again i dont know how to get length of a file on a different
location, because it is needed by store._getlfile at the beggining of file
stream
* store._veryfiles works as usual
* store._getlfile checks where file is by invoking proto.getlfilelocation -
if it is on server than it invokes proto.getlfile, if on different location
than it downloads it from that location

Old Hg on Client, New Hg on Server
* store._verifyfiles works fine
* store._getlfile works fine for files that are on server, in other case it
fails


Any of those ideas have problems with knowing size of largefile, are there
any reason that proto.getlfile must include size at the beggining of the
stream - wouldn't it be easier if client just download all data from stream?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160523/cb42589d/attachment.html>


More information about the Mercurial-devel mailing list