copy cmd proposal
jjberthels at gmail.com
Fri Nov 9 14:43:36 UTC 2007
On 09/11/2007, Mark Smith <smitty at gmail.com> wrote:
> > I'd like to add a copy_file cmd to mogilefs (assuming there isn't one
> > already?).
> What's the use case you're going for here / what problem are you
> trying to solve?
We maintain a level of indirection between user-level files and
back-end stored files, so it is possible for two user-level files to
actually refer to the same back-end storage.
This allows us to save a few % in shared storage (copied files share
storage, we also merge files with identical contents). We need to
break the copy on the (fairly rare) case of a update to a file (we
make use of the edit_file capability). Copy-on-write, effectively.
In that case, we need to create a new copy of the file contents. We
can do this with an app-level read/write loop, but mogile is in a
position to do this with less overall I/O (and potentially much lower
latency, since the common case requires no bulk I/O before returning
to the user - just breaking off a replica and giving it a new fid).
It could also provide a way (other than a read/write loop) to move a
file from one domain/class to another (copy then delete).
More information about the mogilefs