You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Winston Smith <sm...@hotmail.com> on 2011/05/20 04:15:36 UTC

large number of large binary files in subversion

Hi all,

Sorry if this is the wrong list, but I'm curious about one thing:
Are the SVN developers aware of any quirks in SVN in regards
to storing a large number (say, 1000) very large binary files
(say, 1GB each)? So, the entire repository would be 1TB of size,
but my concern is not space, but rather whether SVN would have
difficulties (either on the server side or the client side) handling
such repositories/workspaces. Thanks for your replies.

- Winston

 		 	   		  

RE: large number of large binary files in subversion

Posted by Bob Archer <Bo...@amsi.com>.
> On Mon, May 23, 2011 at 3:07 PM, Konstantin Kolinko
> <kn...@gmail.com> wrote:
> > 2011/5/23 Mark Phippard <ma...@gmail.com>:
> >> On Mon, May 23, 2011 at 2:24 PM, Daniel Shahaf
> <d....@daniel.shahaf.name> wrote:
> >>> Bob Archer wrote on Mon, May 23, 2011 at 13:54:59 -0400:
> >>>> I can't imagine that this would need to move the file over the
> network
> >>>> since it all happens server side. Although, I guess when you
> do an
> >>>> update it might bring the file down again rather than doing a
> local
> >>>> move/rename.
> >>>
> >>> update used to rely on copyfrom information to fetch just the
> delta for
> >>> moves/copies it had already had the base for, but we removed
> that
> >>> feature recently for other reasons.
> >>>
> >>> (I hope other can fill in the details --- such as why we
> removed it and
> >>> what releases will be affected --- I don't remember them
> offhand ): )
> >>
> >> I think Bob is just saying that if you move a file via its URL
> that
> >> nothing needs to transfer over the network.  He acknowledges
> that it
> >> "might" when you do update again.  I would note that if you move
> a
> >> file locally, it also does not have to send it over the network
> when
> >> you perform the commit.  So it is actually probably cheaper to
> do it
> >> locally than on the server if you only have one working copy.
> >>
> >> The feature removed in 1.7 was that on update SVN could
> sometimes move
> >> a file locally rather than download it again.  It was removed
> because
> >> due to the way SVN editor drives work, the feature only worked
> in
> >> certain situations (when the copy was sent to the client before
> the
> >> delete) and apparently the feature was just complicating the
> working
> >> copy code for what amounted to a hack with small benefits.
>  If/when
> >> SVN grows a true rename feature it would have to be implemented
> >> properly.
> >>
> >
> > Ed,
> >
> > In svn 1.7 there is pristine storage area in the working copy,
> where
> > all present files are stored by their checksums. If I understand
> this
> > pristine storage correctly, if you move a file remotely on the
> server
> > (svn mv URL URL) then when you update your working copy and both
> old
> > and new paths are in the same working copy, Subversion will find
> the
> > file in its pristine storage and won't re-download it over
> network. If
> > what I wrote is true (I have not verified whether this actually
> works
> > this way, but I have some hopes),
> 
> AFAIK, this sort of feature was not in scope for 1.7, but it is
> exactly the sort of feature that the WC rewrite will enable for
> future
> versions.  Especially imagine some future version that lets you
> share
> a single pristine store across all your WC's.  You could checkout
> trunk twice and the second one would not even need to transfer any
> files from the server.

Nice but isn't a pristine = base? how would this work if the two working copies had different BASE revisions?

1.7 should be able to locally move a file, but unfortunately even 1.7.0 isn't going to have a "moved" action is it? It will still look like a delete/add to the client?

BOb


Re: large number of large binary files in subversion

Posted by Mark Phippard <ma...@gmail.com>.
On Mon, May 23, 2011 at 3:07 PM, Konstantin Kolinko
<kn...@gmail.com> wrote:
> 2011/5/23 Mark Phippard <ma...@gmail.com>:
>> On Mon, May 23, 2011 at 2:24 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>>> Bob Archer wrote on Mon, May 23, 2011 at 13:54:59 -0400:
>>>> I can't imagine that this would need to move the file over the network
>>>> since it all happens server side. Although, I guess when you do an
>>>> update it might bring the file down again rather than doing a local
>>>> move/rename.
>>>
>>> update used to rely on copyfrom information to fetch just the delta for
>>> moves/copies it had already had the base for, but we removed that
>>> feature recently for other reasons.
>>>
>>> (I hope other can fill in the details --- such as why we removed it and
>>> what releases will be affected --- I don't remember them offhand ): )
>>
>> I think Bob is just saying that if you move a file via its URL that
>> nothing needs to transfer over the network.  He acknowledges that it
>> "might" when you do update again.  I would note that if you move a
>> file locally, it also does not have to send it over the network when
>> you perform the commit.  So it is actually probably cheaper to do it
>> locally than on the server if you only have one working copy.
>>
>> The feature removed in 1.7 was that on update SVN could sometimes move
>> a file locally rather than download it again.  It was removed because
>> due to the way SVN editor drives work, the feature only worked in
>> certain situations (when the copy was sent to the client before the
>> delete) and apparently the feature was just complicating the working
>> copy code for what amounted to a hack with small benefits.  If/when
>> SVN grows a true rename feature it would have to be implemented
>> properly.
>>
>
> Ed,
>
> In svn 1.7 there is pristine storage area in the working copy, where
> all present files are stored by their checksums. If I understand this
> pristine storage correctly, if you move a file remotely on the server
> (svn mv URL URL) then when you update your working copy and both old
> and new paths are in the same working copy, Subversion will find the
> file in its pristine storage and won't re-download it over network. If
> what I wrote is true (I have not verified whether this actually works
> this way, but I have some hopes),

AFAIK, this sort of feature was not in scope for 1.7, but it is
exactly the sort of feature that the WC rewrite will enable for future
versions.  Especially imagine some future version that lets you share
a single pristine store across all your WC's.  You could checkout
trunk twice and the second one would not even need to transfer any
files from the server.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 05/24/2011 11:47 AM, Stefan Sperling wrote:
> On Tue, May 24, 2011 at 11:30:39AM -0400, C. Michael Pilato wrote:
>> I held off on committing my RA work because there were no consumers.  But
>> I've still considering making the change because a) there's no penalty for
>> doing so, and b) maybe if we add the requisite client-side magic in 1.8, 1.7
>> servers would already be advertising the sha1 checksum that code would need.
> 
> Sounds like an excellent plan to me, if there really is no penalty.

I call the FS function in a way that says, "give me the SHA1 if you have it
handy, but don't go calculate it if you don't."  So, a little bit of FS
query cost, some additional bytes on the wire, but that's about it.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Greg Stein <gs...@gmail.com>.
On May 24, 2011 11:47 AM, "Stefan Sperling" <st...@elego.de> wrote:
>
> On Tue, May 24, 2011 at 11:30:39AM -0400, C. Michael Pilato wrote:
> > I held off on committing my RA work because there were no consumers.
 But
> > I've still considering making the change because a) there's no penalty
for
> > doing so, and b) maybe if we add the requisite client-side magic in 1.8,
1.7
> > servers would already be advertising the sha1 checksum that code would
need.
>
> Sounds like an excellent plan to me, if there really is no penalty.

Agreed!

Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Stefan Sperling <st...@elego.de>.
On Tue, May 24, 2011 at 11:30:39AM -0400, C. Michael Pilato wrote:
> I held off on committing my RA work because there were no consumers.  But
> I've still considering making the change because a) there's no penalty for
> doing so, and b) maybe if we add the requisite client-side magic in 1.8, 1.7
> servers would already be advertising the sha1 checksum that code would need.

Sounds like an excellent plan to me, if there really is no penalty.

Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Julian Foad <ju...@wandisco.com>.
On Tue, 2011-05-24 at 18:21 +0200, Branko Čibej wrote:
> On 24.05.2011 17:53, Arwin Arni wrote:
> >> I was hoping to slip in
> >> support for avoiding those text transfers altogether where possible. 
> >> But I
> >> ran into the obvious problems with the editor interface.  (Also, I
> >> became
> >> concerned about the possibility of a race condition in the pristines
> >> table
> >> -- client says "Yep, I've got that text already!", edit continues while
> >> simultaneously in some other part of the tree that text is removed, edit
> >> goes to reference the supposedly redundant checksum and it ain't
> >> there no mo'.)
> >>
> >
> > Can't we increase the ref-count of the pristine node on getting the
> > <add-file...> element... this way, we need not worry about a parallel
> > <delete-file..> (IIUC delete-file will only reduce the ref-count, and
> > the actual removal of the pristine node is taken care of after the
> > entire editor drive.. atleast.. this is the way it is in my head)
> 
> <add-file> ... inc(refcount) ... commit ... ^C .... eep!
> 
> In other words, 'tain't that simple ... on the other hand, the worst
> that can happen is that an unused pristine never gets removed from disk.

The ref-count in the DB is an "internal" ref-count: that is, it only
counts the references that are present in the DB itself (in the NODES
table), and not logical references that the program might be holding in
its volatile memory.  This was a decision in order to keep the design of
that subcomponent simple.

- Julian



Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 05/25/2011 10:42 AM, Bert Huijben wrote:
> To resolve this and similar problems we defined that we are not allowed
> to remove pristines with refcount zero until there are no more workqueue
> items, and nobody else has a working copy lock.
> 
> (During update the only reference to a pristine is in memory. In some
> other cases the only reference might be in a skel in the workqueue).
> 
> So no need to update the refcount.

Brilliant!

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


RE: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Branko Čibej [mailto:brane@xbc.nu] On Behalf Of Branko Cibej
> Sent: dinsdag 24 mei 2011 18:22
> To: dev@subversion.apache.org
> Subject: Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large
> number of large binary files in subversion")
> 
> On 24.05.2011 17:53, Arwin Arni wrote:
> >> I was hoping to slip in
> >> support for avoiding those text transfers altogether where possible.
> >> But I
> >> ran into the obvious problems with the editor interface.  (Also, I
> >> became
> >> concerned about the possibility of a race condition in the pristines
> >> table
> >> -- client says "Yep, I've got that text already!", edit continues while
> >> simultaneously in some other part of the tree that text is removed, edit
> >> goes to reference the supposedly redundant checksum and it ain't
> >> there no mo'.)
> >>
> >
> > Can't we increase the ref-count of the pristine node on getting the
> > <add-file...> element... this way, we need not worry about a parallel
> > <delete-file..> (IIUC delete-file will only reduce the ref-count, and
> > the actual removal of the pristine node is taken care of after the
> > entire editor drive.. atleast.. this is the way it is in my head)
> 
> <add-file> ... inc(refcount) ... commit ... ^C .... eep!
> 
> In other words, 'tain't that simple ... on the other hand, the worst
> that can happen is that an unused pristine never gets removed from disk.

To resolve this and similar problems we defined that we are not allowed to remove pristines with refcount zero until there are no more workqueue items, and nobody else has a working copy lock.

(During update the only reference to a pristine is in memory. In some other cases the only reference might be in a skel in the workqueue).

So no need to update the refcount.

	Bert



Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Branko Čibej <br...@e-reka.si>.
On 24.05.2011 17:53, Arwin Arni wrote:
>> I was hoping to slip in
>> support for avoiding those text transfers altogether where possible. 
>> But I
>> ran into the obvious problems with the editor interface.  (Also, I
>> became
>> concerned about the possibility of a race condition in the pristines
>> table
>> -- client says "Yep, I've got that text already!", edit continues while
>> simultaneously in some other part of the tree that text is removed, edit
>> goes to reference the supposedly redundant checksum and it ain't
>> there no mo'.)
>>
>
> Can't we increase the ref-count of the pristine node on getting the
> <add-file...> element... this way, we need not worry about a parallel
> <delete-file..> (IIUC delete-file will only reduce the ref-count, and
> the actual removal of the pristine node is taken care of after the
> entire editor drive.. atleast.. this is the way it is in my head)

<add-file> ... inc(refcount) ... commit ... ^C .... eep!

In other words, 'tain't that simple ... on the other hand, the worst
that can happen is that an unused pristine never gets removed from disk.

-- Brane


Re: [PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by Arwin Arni <ar...@collab.net>.
On Tuesday 24 May 2011 09:00 PM, C. Michael Pilato wrote:
> On 05/24/2011 04:23 AM, Stefan Sperling wrote:
>> On Tue, May 24, 2011 at 12:04:26PM +0530, Arwin Arni wrote:
>>> Why can't we send the recorded checksum from the server instead of
>>> sending the whole file and then calculating it on the client side?
>>>
>>> If the checksum matches one of the pristine files, then use that to
>>> populate the nodes table. If there is no match, only then do we
>>> spool to a temporary file and what not.
>>>
>>> This seems like a straightforward idea. Any pitfalls to this approach?
>> The pitfall is that you need to change the client<->server interface.
>>
>> The current interface at subversion/include/svn_delta.h only transmits
>> checksums before and after applying deltas. First it transmits the checksum
>> of the expected base text for the delta (apply_textdelta), and then,
>> after the delta has been applied, it sends the expected checksum of the
>> content resulting from application of the delta to the base (close_file).
>> This interface doesn't prevent data from being transmitted.
> Heheh... I'm sitting on a patch which transmits the "final sha1 checksum"
> *before* file contents would be transmitted over DAV.  Something I whipped
> up before hopping on the plane out of Berlin.

Nice :)

> I was hoping to slip in
> support for avoiding those text transfers altogether where possible.  But I
> ran into the obvious problems with the editor interface.  (Also, I became
> concerned about the possibility of a race condition in the pristines table
> -- client says "Yep, I've got that text already!", edit continues while
> simultaneously in some other part of the tree that text is removed, edit
> goes to reference the supposedly redundant checksum and it ain't there no mo'.)
>

Can't we increase the ref-count of the pristine node on getting the 
<add-file...> element... this way, we need not worry about a parallel 
<delete-file..> (IIUC delete-file will only reduce the ref-count, and 
the actual removal of the pristine node is taken care of after the 
entire editor drive.. atleast.. this is the way it is in my head)

> I held off on committing my RA work because there were no consumers.  But
> I've still considering making the change because a) there's no penalty for
> doing so, and b) maybe if we add the requisite client-side magic in 1.8, 1.7
> servers would already be advertising the sha1 checksum that code would need.
>
> Thoughts?
>
> I'll attach my patch which, if accepted in 1.7, should probably be expanded
> to cover svnserve, too.
>


[PATCH] Server-transmitted "final SHA1 checksums" (Was: "large number of large binary files in subversion")

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 05/24/2011 04:23 AM, Stefan Sperling wrote:
> On Tue, May 24, 2011 at 12:04:26PM +0530, Arwin Arni wrote:
>> Why can't we send the recorded checksum from the server instead of
>> sending the whole file and then calculating it on the client side?
>>
>> If the checksum matches one of the pristine files, then use that to
>> populate the nodes table. If there is no match, only then do we
>> spool to a temporary file and what not.
>>
>> This seems like a straightforward idea. Any pitfalls to this approach?
> 
> The pitfall is that you need to change the client<->server interface.
> 
> The current interface at subversion/include/svn_delta.h only transmits
> checksums before and after applying deltas. First it transmits the checksum
> of the expected base text for the delta (apply_textdelta), and then,
> after the delta has been applied, it sends the expected checksum of the
> content resulting from application of the delta to the base (close_file).
> This interface doesn't prevent data from being transmitted.

Heheh... I'm sitting on a patch which transmits the "final sha1 checksum"
*before* file contents would be transmitted over DAV.  Something I whipped
up before hopping on the plane out of Berlin.  I was hoping to slip in
support for avoiding those text transfers altogether where possible.  But I
ran into the obvious problems with the editor interface.  (Also, I became
concerned about the possibility of a race condition in the pristines table
-- client says "Yep, I've got that text already!", edit continues while
simultaneously in some other part of the tree that text is removed, edit
goes to reference the supposedly redundant checksum and it ain't there no mo'.)

I held off on committing my RA work because there were no consumers.  But
I've still considering making the change because a) there's no penalty for
doing so, and b) maybe if we add the requisite client-side magic in 1.8, 1.7
servers would already be advertising the sha1 checksum that code would need.

Thoughts?

I'll attach my patch which, if accepted in 1.7, should probably be expanded
to cover svnserve, too.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: large number of large binary files in subversion

Posted by Stefan Sperling <st...@elego.de>.
On Tue, May 24, 2011 at 12:04:26PM +0530, Arwin Arni wrote:
> Why can't we send the recorded checksum from the server instead of
> sending the whole file and then calculating it on the client side?
> 
> If the checksum matches one of the pristine files, then use that to
> populate the nodes table. If there is no match, only then do we
> spool to a temporary file and what not.
> 
> This seems like a straightforward idea. Any pitfalls to this approach?

The pitfall is that you need to change the client<->server interface.

The current interface at subversion/include/svn_delta.h only transmits
checksums before and after applying deltas. First it transmits the checksum
of the expected base text for the delta (apply_textdelta), and then,
after the delta has been applied, it sends the expected checksum of the
content resulting from application of the delta to the base (close_file).
This interface doesn't prevent data from being transmitted.

A newer, albeit currently unusued, interface is at
subversion/include/private/svn_editor.h.
This transmits the checksum of the expected content (svn_editor_set_text).
Supporting this new interface is a major piece of work planned for post-1.7.

Re: large number of large binary files in subversion

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
[ old thread, but I'd like to add this warning to the archives: ]

> > > > If you ensure that no commits happen during the backup period you
> > > > could use rsync instead.
> > >
> > > It is not safe to rsync live Subversion filesystems. (the result may or
> > > may not be corrupt)
> >
> > That's why I said that no commits should happen. But thanks for
> > spelling it out more explicitly.
> 
> I believe an SVN repo can be put into read-only mode quickly by

Your suggested method may cause corruption in two different ways.

> linking the pre_commit hook to /bin/false (linking is believed to be
> an atomic operation, so no race conditions) and wait a bit to let all
> commits finish. Read operations are guaranteed to not alter the repo
> files. rsyncing should then be ok, but I still prefer to hotcopy since
> this is the canonical way to go...
> 

RE: large number of large binary files in subversion

Posted by Winston Smith <sm...@hotmail.com>.
----------------------------------------
> Date: Wed, 25 May 2011 12:17:07 +0200
> From: stsp@elego.de
> To: d.s@daniel.shahaf.name
> CC: smith_winston_6079@hotmail.com; dev@subversion.apache.org
> Subject: Re: large number of large binary files in subversion
>
> On Wed, May 25, 2011 at 01:02:28PM +0300, Daniel Shahaf wrote:
> > Stefan Sperling wrote on Wed, May 25, 2011 at 11:45:21 +0200:
> > > On Wed, May 25, 2011 at 10:03:16AM +1100, Winston Smith wrote:
> > > > Yes, I planned to do that for a read-only backup repository as part of
> > > > various backup schedules (daily, weekly, monthly, yearly).
> > >
> > > Unfortunately there is no incremental hotcopy support yet,
> > > see http://subversion.tigris.org/issues/show_bug.cgi?id=3815

That won't be necessary as per design. A hotcopy is always meant to
be used in a full backup. SVN uses delta-storage, so it *is* effectivly
doing an incremental backup already. All one has to do is to consolidate
these incremental backups into one full backup. Something one would
have to do anyway when recovering if SVN didn't do it.

> > > If you ensure that no commits happen during the backup period you
> > > could use rsync instead.
> >
> > It is not safe to rsync live Subversion filesystems. (the result may or
> > may not be corrupt)
>
> That's why I said that no commits should happen. But thanks for
> spelling it out more explicitly.

I recently heard of someone who did an rsync of live postgresql databases
as part of his backup schedule, and was wondering why the result is
corrupted... I believe an SVN repo can be put into read-only mode quickly
by linking the pre_commit hook to /bin/false (linking is believed to be
an atomic operation, so no race conditions) and wait a bit to let all commits
finish. Read operations are guaranteed to not alter the repo files. rsyncing
should then be ok, but I still prefer to hotcopy since this is the canonical way
to go...

I like canonical and dedicated ways to do things. Rsync seems to be a silver
bullet here...

- Winston

 		 	   		  

Re: large number of large binary files in subversion

Posted by Stefan Sperling <st...@elego.de>.
On Wed, May 25, 2011 at 01:02:28PM +0300, Daniel Shahaf wrote:
> Stefan Sperling wrote on Wed, May 25, 2011 at 11:45:21 +0200:
> > On Wed, May 25, 2011 at 10:03:16AM +1100, Winston Smith wrote:
> > > Yes, I planned to do that for a read-only backup repository as part of
> > > various backup schedules (daily, weekly, monthly, yearly).
> > 
> > Unfortunately there is no incremental hotcopy support yet,
> > see http://subversion.tigris.org/issues/show_bug.cgi?id=3815
> > 
> > If you ensure that no commits happen during the backup period you
> > could use rsync instead.
> 
> It is not safe to rsync live Subversion filesystems. (the result may or
> may not be corrupt)

That's why I said that no commits should happen. But thanks for
spelling it out more explicitly.

Re: large number of large binary files in subversion

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Stefan Sperling wrote on Wed, May 25, 2011 at 11:45:21 +0200:
> On Wed, May 25, 2011 at 10:03:16AM +1100, Winston Smith wrote:
> > Yes, I planned to do that for a read-only backup repository as part of
> > various backup schedules (daily, weekly, monthly, yearly).
> 
> Unfortunately there is no incremental hotcopy support yet,
> see http://subversion.tigris.org/issues/show_bug.cgi?id=3815
> 
> If you ensure that no commits happen during the backup period you
> could use rsync instead.

It is not safe to rsync live Subversion filesystems. (the result may or
may not be corrupt)

AW: large number of large binary files in subversion

Posted by Markus Schaber <m....@3s-software.com>.
Hi,

> Von: Stefan Sperling [mailto:stsp@elego.de]
> > > using
> > > 'svnadmin hotcopy' to copy your repositories to it once a week or
so
> >
> > Yes, I planned to do that for a read-only backup repository as part
of
> > various backup schedules (daily, weekly, monthly, yearly).
> 
> Unfortunately there is no incremental hotcopy support yet, see
> http://subversion.tigris.org/issues/show_bug.cgi?id=3815
> 
> If you ensure that no commits happen during the backup period you
could
> use rsync instead.

Or maybe svnsync.

Best regards

Markus Schaber

-- 
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 |
Fax +49-831-54031-50

Email: m.schaber@3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects:
http://www.3s-software.com/index.shtml?sample_projects

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner |
Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 


Re: large number of large binary files in subversion

Posted by Stefan Sperling <st...@elego.de>.
On Wed, May 25, 2011 at 10:03:16AM +1100, Winston Smith wrote:
> 
> > > repo(s) is/are on a permanently mounted USB disk.
> >
> > The USB stick might give you less i/o throughput than an internal hard
> > disk, and it might fail early due to flash wearing out.
> 
> I believe I mentioned a disk, not a stick. But thanks anyway...

Ah, sorry I misread what you wrote.

All these zillions of storage methods can be confusing.
Just recently someone (not me, but I wouldn't be surprised if it had been me)
was saying that the Apache Software Foundation's Subversion repository was
hosted on an SD card for performance reasons but really meant SSD :)
 
> > using
> > 'svnadmin hotcopy' to copy your repositories to it once a week or so
> 
> Yes, I planned to do that for a read-only backup repository as part of
> various backup schedules (daily, weekly, monthly, yearly).

Unfortunately there is no incremental hotcopy support yet,
see http://subversion.tigris.org/issues/show_bug.cgi?id=3815

If you ensure that no commits happen during the backup period you
could use rsync instead.

RE: large number of large binary files in subversion

Posted by Winston Smith <sm...@hotmail.com>.
> > repo(s) is/are on a permanently mounted USB disk.
>
> The USB stick might give you less i/o throughput than an internal hard
> disk, and it might fail early due to flash wearing out.

I believe I mentioned a disk, not a stick. But thanks anyway...

> using
> 'svnadmin hotcopy' to copy your repositories to it once a week or so

Yes, I planned to do that for a read-only backup repository as part of
various backup schedules (daily, weekly, monthly, yearly).

- Winston

 		 	   		  

Re: large number of large binary files in subversion

Posted by Stefan Sperling <st...@elego.de>.
On Tue, May 24, 2011 at 06:02:07PM +1100, Winston Smith wrote:
> 
> Folks,
> 
> Thanks for your replies. So, in principle, I should not expect any problems.
> The machine would be a decent one-core Athlon3500+ with 2GB RAM,
> doing nothing else other than serving  bugzilla, reviewboard and mediawiki
> with lighttpd, and the repo(s) is/are on a permanently mounted USB disk.

The USB stick might give you less i/o throughput than an internal hard
disk, and it might fail early due to flash wearing out.

Otherwise this sounds like a fine setup to me. In any case please do
not forget to keep backups (investing in another big disk and using
'svnadmin hotcopy' to copy your repositories to it once a week or so
will pay off as soon as the primary disk fails).

RE: large number of large binary files in subversion

Posted by Winston Smith <sm...@hotmail.com>.
Folks,

Thanks for your replies. So, in principle, I should not expect any problems.
The machine would be a decent one-core Athlon3500+ with 2GB RAM,
doing nothing else other than serving  bugzilla, reviewboard and mediawiki
with lighttpd, and the repo(s) is/are on a permanently mounted USB disk.
Network throughput would not be the issue since the working copies
would be on the same machine.

I am aware that operations like copy, move, update, commit would take
time and/or space, but these files and their locations rarely change.
I was more concerned about the likelihood of repository corruption.
But this does not seem to be of any concern.

Thanks again.

- Winston

----------------------------------------
> Date: Tue, 24 May 2011 12:04:26 +0530
> From: arwin@collab.net
> To: dev@subversion.apache.org
> Subject: Re: large number of large binary files in subversion
>
> On Tuesday 24 May 2011 12:58 AM, Stefan Sperling wrote:
> > On Mon, May 23, 2011 at 11:07:50PM +0400, Konstantin Kolinko wrote:
> >> In svn 1.7 there is pristine storage area in the working copy, where
> >> all present files are stored by their checksums. If I understand this
> >> pristine storage correctly, if you move a file remotely on the server
> >> (svn mv URL URL) then when you update your working copy and both old
> >> and new paths are in the same working copy, Subversion will find the
> >> file in its pristine storage and won't re-download it over network. If
> >> what I wrote is true (I have not verified whether this actually works
> >> this way, but I have some hopes),
> >
> > Unfortunately, that's not how it works.
> >
> > When a new file is added during an update, the entire file content is
> > first spooled to a temporary file to calculcate its checksum.
> > If a pristine with the same checksum is already present, the temporary
> > file is deleted.
> >
> > (see pristine_install_txn() in subversion/libsvn_wc/wc_db_pristine.c)
> Why can't we send the recorded checksum from the server instead of
> sending the whole file and then calculating it on the client side?
>
> If the checksum matches one of the pristine files, then use that to
> populate the nodes table. If there is no match, only then do we spool to
> a temporary file and what not.
>
> This seems like a straightforward idea. Any pitfalls to this approach?
 		 	   		  

Re: large number of large binary files in subversion

Posted by Arwin Arni <ar...@collab.net>.
On Tuesday 24 May 2011 12:58 AM, Stefan Sperling wrote:
> On Mon, May 23, 2011 at 11:07:50PM +0400, Konstantin Kolinko wrote:
>> In svn 1.7 there is pristine storage area in the working copy, where
>> all present files are stored by their checksums. If I understand this
>> pristine storage correctly, if you move a file remotely on the server
>> (svn mv URL URL) then when you update your working copy and both old
>> and new paths are in the same working copy, Subversion will find the
>> file in its pristine storage and won't re-download it over network. If
>> what I wrote is true (I have not verified whether this actually works
>> this way, but I have some hopes),
>
> Unfortunately, that's not how it works.
>
> When a new file is added during an update, the entire file content is
> first spooled to a temporary file to calculcate its checksum.
> If a pristine with the same checksum is already present, the temporary
> file is deleted.
>
> (see pristine_install_txn() in subversion/libsvn_wc/wc_db_pristine.c)
Why can't we send the recorded checksum from the server instead of 
sending the whole file and then calculating it on the client side?

If the checksum matches one of the pristine files, then use that to 
populate the nodes table. If there is no match, only then do we spool to 
a temporary file and what not.

This seems like a straightforward idea. Any pitfalls to this approach?

Re: large number of large binary files in subversion

Posted by Stefan Sperling <st...@elego.de>.
On Mon, May 23, 2011 at 11:07:50PM +0400, Konstantin Kolinko wrote:
> In svn 1.7 there is pristine storage area in the working copy, where
> all present files are stored by their checksums. If I understand this
> pristine storage correctly, if you move a file remotely on the server
> (svn mv URL URL) then when you update your working copy and both old
> and new paths are in the same working copy, Subversion will find the
> file in its pristine storage and won't re-download it over network. If
> what I wrote is true (I have not verified whether this actually works
> this way, but I have some hopes),

Unfortunately, that's not how it works.

When a new file is added during an update, the entire file content is
first spooled to a temporary file to calculcate its checksum.
If a pristine with the same checksum is already present, the temporary
file is deleted.

(see pristine_install_txn() in subversion/libsvn_wc/wc_db_pristine.c)

Re: large number of large binary files in subversion

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/5/23 Mark Phippard <ma...@gmail.com>:
> On Mon, May 23, 2011 at 2:24 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>> Bob Archer wrote on Mon, May 23, 2011 at 13:54:59 -0400:
>>> I can't imagine that this would need to move the file over the network
>>> since it all happens server side. Although, I guess when you do an
>>> update it might bring the file down again rather than doing a local
>>> move/rename.
>>
>> update used to rely on copyfrom information to fetch just the delta for
>> moves/copies it had already had the base for, but we removed that
>> feature recently for other reasons.
>>
>> (I hope other can fill in the details --- such as why we removed it and
>> what releases will be affected --- I don't remember them offhand ): )
>
> I think Bob is just saying that if you move a file via its URL that
> nothing needs to transfer over the network.  He acknowledges that it
> "might" when you do update again.  I would note that if you move a
> file locally, it also does not have to send it over the network when
> you perform the commit.  So it is actually probably cheaper to do it
> locally than on the server if you only have one working copy.
>
> The feature removed in 1.7 was that on update SVN could sometimes move
> a file locally rather than download it again.  It was removed because
> due to the way SVN editor drives work, the feature only worked in
> certain situations (when the copy was sent to the client before the
> delete) and apparently the feature was just complicating the working
> copy code for what amounted to a hack with small benefits.  If/when
> SVN grows a true rename feature it would have to be implemented
> properly.
>

Ed,

In svn 1.7 there is pristine storage area in the working copy, where
all present files are stored by their checksums. If I understand this
pristine storage correctly, if you move a file remotely on the server
(svn mv URL URL) then when you update your working copy and both old
and new paths are in the same working copy, Subversion will find the
file in its pristine storage and won't re-download it over network. If
what I wrote is true (I have not verified whether this actually works
this way, but I have some hopes), then it will save you some network
traffic but won't save you from local i/o operation of deleting the
old file and copying a new copy of it from pristine storage. It may be
that it will depend on what network library and protocol will be used.

IIRC Subversion 1.4 server does not know how to skip unwanted data
when serving a sparse working copy, so there might be no way for such
optimizations when operating recent client with your server.

Best regards,
Konstantin Kolinko

Re: large number of large binary files in subversion

Posted by Mark Phippard <ma...@gmail.com>.
On Mon, May 23, 2011 at 2:24 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Bob Archer wrote on Mon, May 23, 2011 at 13:54:59 -0400:
>> I can't imagine that this would need to move the file over the network
>> since it all happens server side. Although, I guess when you do an
>> update it might bring the file down again rather than doing a local
>> move/rename.
>
> update used to rely on copyfrom information to fetch just the delta for
> moves/copies it had already had the base for, but we removed that
> feature recently for other reasons.
>
> (I hope other can fill in the details --- such as why we removed it and
> what releases will be affected --- I don't remember them offhand ): )

I think Bob is just saying that if you move a file via its URL that
nothing needs to transfer over the network.  He acknowledges that it
"might" when you do update again.  I would note that if you move a
file locally, it also does not have to send it over the network when
you perform the commit.  So it is actually probably cheaper to do it
locally than on the server if you only have one working copy.

The feature removed in 1.7 was that on update SVN could sometimes move
a file locally rather than download it again.  It was removed because
due to the way SVN editor drives work, the feature only worked in
certain situations (when the copy was sent to the client before the
delete) and apparently the feature was just complicating the working
copy code for what amounted to a hack with small benefits.  If/when
SVN grows a true rename feature it would have to be implemented
properly.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: large number of large binary files in subversion

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bob Archer wrote on Mon, May 23, 2011 at 13:54:59 -0400:
> I can't imagine that this would need to move the file over the network
> since it all happens server side. Although, I guess when you do an
> update it might bring the file down again rather than doing a local
> move/rename. 

update used to rely on copyfrom information to fetch just the delta for
moves/copies it had already had the base for, but we removed that
feature recently for other reasons.

(I hope other can fill in the details --- such as why we removed it and
what releases will be affected --- I don't remember them offhand ): )

RE: large number of large binary files in subversion

Posted by Bob Archer <Bo...@amsi.com>.
> I keep my personal photos and videos in Subversion.
> Total repository size is currently 475 GB.  There are
> some large (1-4 GB) video files.  Everything seems to
> work fine.
> 
> Some details: I'm still running Subversion 1.4.6 on the
> server (FSFS, CentOS 5, x86_64).  Running 1.6.16
> cmdline client on CentOS and latest TortoiseSvn on
> Windows XP (32 bit).  I should try upgrading the server
> at some point, but it does make me nervous, requires
> a lot of space for backups etc.
> 
> The most annoying thing is probably the lack of true
> moves and renames -- it takes a long time to move a
> large file because it doesn't just move it on the client
> side, it deletes it and recopies the whole thing over
> the network (IIUC). I basically never modify any large
> files, I just move them around and rename them.

You should be able to do a server side move... if you look at the help for mv command you will see:

SRC and DST can both be working copy (WC) paths or URLs:
   WC  -> WC:   move and schedule for addition (with history)
   URL -> URL:  complete server-side rename.
All the SRCs must be of the same type.

So you can do something like:

svn mv http://myserver/repo/MyFile.jpg http://myserver/repo/newPath/MyNewFile.jpg

I can't imagine that this would need to move the file over the network since it all happens server side. Although, I guess when you do an update it might bring the file down again rather than doing a local move/rename. 

BOb


> 
> Overall I'm quite happy using Subversion for this.
> 
> (I should try to make an effort to test 1.7, since it's
> an interesting and somewhat unusual workload...)
> 
> HTH,
> -Ed
> 
> PS TortoiseSvn working copy is 950 GB, 351K files,
> 30K folders, according to Windows "Properties".
> 
> 
> On Mon, May 23, 2011 at 7:36 AM, Julian Foad
> <ju...@wandisco.com> wrote:
> > On Fri, 2011-05-20, Winston Smith wrote:
> >> Sorry if this is the wrong list, but I'm curious about one
> thing:
> >> Are the SVN developers aware of any quirks in SVN in regards
> >> to storing a large number (say, 1000) very large binary files
> >> (say, 1GB each)? So, the entire repository would be 1TB of size,
> >> but my concern is not space, but rather whether SVN would have
> >> difficulties (either on the server side or the client side)
> handling
> >> such repositories/workspaces. Thanks for your replies.
> >
> > I can't give a very definite answer, but, assuming your server
> and
> > network and client hardware is adequately sized for the task, I
> would
> > expect:
> >
> >  * No problem handling many thousands of files in total.
> >
> >  * Putting 1000 or more files all in the same directory can give
> poor
> > performance in time and/or space, on both client and server, so
> avoid
> > doing that.
> >
> >  * Subversion can handle "binary" files as large as 1 GB or even
> many
> > GB.  There used to be a 2 GB limit when using old versions of
> Subversion
> > in certain configurations, but that limit is long gone.  I have
> heard
> > that the server can be very slow if a new version of a very large
> file
> > consists of a completely different bit pattern from the previous
> > version.  If your files don't change much, or if you only add new
> files
> > and delete old files instead of checking in modifications to the
> > existing files, that won't be an issue.
> >
> >  * Subversion is designed to process large amounts of data
> "streamily"
> > without trying to read it all into RAM at once, so you shouldn't
> need
> > excessive amounts of RAM.
> >
> > I hope that helps.  Please let us know what results you get.  If
> you do
> > run into any problem we'd like to know about it and try to fix
> it.
> >
> > - Julian
> >
> >
> >

Re: large number of large binary files in subversion

Posted by Ed Price <ed...@gmail.com>.
I keep my personal photos and videos in Subversion.
Total repository size is currently 475 GB.  There are
some large (1-4 GB) video files.  Everything seems to
work fine.

Some details: I'm still running Subversion 1.4.6 on the
server (FSFS, CentOS 5, x86_64).  Running 1.6.16
cmdline client on CentOS and latest TortoiseSvn on
Windows XP (32 bit).  I should try upgrading the server
at some point, but it does make me nervous, requires
a lot of space for backups etc.

The most annoying thing is probably the lack of true
moves and renames -- it takes a long time to move a
large file because it doesn't just move it on the client
side, it deletes it and recopies the whole thing over
the network (IIUC). I basically never modify any large
files, I just move them around and rename them.

Overall I'm quite happy using Subversion for this.

(I should try to make an effort to test 1.7, since it's
an interesting and somewhat unusual workload...)

HTH,
-Ed

PS TortoiseSvn working copy is 950 GB, 351K files,
30K folders, according to Windows "Properties".


On Mon, May 23, 2011 at 7:36 AM, Julian Foad <ju...@wandisco.com> wrote:
> On Fri, 2011-05-20, Winston Smith wrote:
>> Sorry if this is the wrong list, but I'm curious about one thing:
>> Are the SVN developers aware of any quirks in SVN in regards
>> to storing a large number (say, 1000) very large binary files
>> (say, 1GB each)? So, the entire repository would be 1TB of size,
>> but my concern is not space, but rather whether SVN would have
>> difficulties (either on the server side or the client side) handling
>> such repositories/workspaces. Thanks for your replies.
>
> I can't give a very definite answer, but, assuming your server and
> network and client hardware is adequately sized for the task, I would
> expect:
>
>  * No problem handling many thousands of files in total.
>
>  * Putting 1000 or more files all in the same directory can give poor
> performance in time and/or space, on both client and server, so avoid
> doing that.
>
>  * Subversion can handle "binary" files as large as 1 GB or even many
> GB.  There used to be a 2 GB limit when using old versions of Subversion
> in certain configurations, but that limit is long gone.  I have heard
> that the server can be very slow if a new version of a very large file
> consists of a completely different bit pattern from the previous
> version.  If your files don't change much, or if you only add new files
> and delete old files instead of checking in modifications to the
> existing files, that won't be an issue.
>
>  * Subversion is designed to process large amounts of data "streamily"
> without trying to read it all into RAM at once, so you shouldn't need
> excessive amounts of RAM.
>
> I hope that helps.  Please let us know what results you get.  If you do
> run into any problem we'd like to know about it and try to fix it.
>
> - Julian
>
>
>

Re: large number of large binary files in subversion

Posted by Julian Foad <ju...@wandisco.com>.
On Fri, 2011-05-20, Winston Smith wrote:
> Sorry if this is the wrong list, but I'm curious about one thing:
> Are the SVN developers aware of any quirks in SVN in regards
> to storing a large number (say, 1000) very large binary files
> (say, 1GB each)? So, the entire repository would be 1TB of size,
> but my concern is not space, but rather whether SVN would have
> difficulties (either on the server side or the client side) handling
> such repositories/workspaces. Thanks for your replies.

I can't give a very definite answer, but, assuming your server and
network and client hardware is adequately sized for the task, I would
expect:

  * No problem handling many thousands of files in total.

  * Putting 1000 or more files all in the same directory can give poor
performance in time and/or space, on both client and server, so avoid
doing that.

  * Subversion can handle "binary" files as large as 1 GB or even many
GB.  There used to be a 2 GB limit when using old versions of Subversion
in certain configurations, but that limit is long gone.  I have heard
that the server can be very slow if a new version of a very large file
consists of a completely different bit pattern from the previous
version.  If your files don't change much, or if you only add new files
and delete old files instead of checking in modifications to the
existing files, that won't be an issue.

  * Subversion is designed to process large amounts of data "streamily"
without trying to read it all into RAM at once, so you shouldn't need
excessive amounts of RAM.

I hope that helps.  Please let us know what results you get.  If you do
run into any problem we'd like to know about it and try to fix it.

- Julian