You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Anderson <da...@natulte.net> on 2007/01/17 07:36:58 UTC
Another working copy library
I've been kicking the thought around for a while now, so I'll get it
out here in the open.
I think we all know about the "organic" growth of libsvn_wc. As more
large projects like gcc or KDE adopt Subversion, they are starting to
also run into scalability issues with the working copy library that
cannot be resolved easily (not to mention companies that have groaned
a little about this).
The ones I can think of right now:
- Having to crawl the entire tree on most operations to compute local
changes. While not too bad for a vast majority of users, large trees
take a long time to crawl, and don't even get me started on large tree
+ nfs.
- Storing metadata all over the place. This is by design, to allow
for working copy severability. It's a nice feature, but it's many more
inodes than is reasonable on large trees. And it's another component
of having to recrawl a huge tree for most operations.
- Text-base storage. Being able to forego these, or even fetch them
on-demand, has been a feature request for a long, long time. It
doesn't look to me like we'll be implementing this any time soon,
because of the state of libsvn_wc.
- Doesn't play well with other commandline tools. When I do find or
grep runs over a working copy, I always have to pipe that through
`grep -v .svn` to filter out all the dupes. The tool still has to
crawl twice the number of inodes and output twice the actual amount of
data. And yes, I'm sure there is a nifty hidden switch in both find
and grep that would let me exclude this intelligently. I'm sure I can
find another tree-crawling tool that we equally break and that doesn't
have an exclusion capability.
So, basically, I think that our working copy design has worked okay
for most people, but it's now shown its limits, and it might be time
for a change.
So, I want to break libsvn_wc.
Okay, now, calm down, and read through before killing me.
I've been thinking about an alternative to libsvn_wc. The semantics of
this alternative library would be slightly different, enough that it
would not be perfectly compatible with the existing libsvn_wc. This is
why I propose this as an alternative library that follows as much as
possible of the current svn_wc.h API, that would be selected/enabled
at runtime, using a dynlib mechanism similar to the one we have for ra
and fs backends. From here on, I'll refer to this alternative
implementation as libsvn_wc_sqlite.
libsvn_wc_sqlite stores all the metadata for a working copy in a
*single* SQLite database. This sqlite database is located in a .svn
subdirectory inside the root of the working copy. So, for example, if
you were to check out the svn trunk from svn.collab.net, you would
have trunk/.svn containing wc.db (and probably some other very
lightweight stuff, like a wc version file). There is no other .svn
directory anywhere else in the working copy. When you invoke an svn
command that needs to look at the working copy, libsvn_wc_sqlite walks
back up the tree from the cwd until it finds a .svn directory, and
uses that metadata for the entire tree rooted at that directory.
This preserves working copy portability, and breaks working copy
severability. That is, you can still move an entire checkout ('trunk'
in my previous example) somewhere else and have a working WC, but you
can't move a subtree out (say 'trunk/subversion') and have that be a
functionning working copy for that subtree. In fact, doing the latter
would have the effect of exporting that subtree: no metadata, just the
files.
I have never really used WC severability, but I understand there are
use cases, and more importantly, users of this feature. This would be
a first API exclusive to libsvn_wc_sqlite, something like
svn_wc_sever(), which takes a subtree of a WC and makes into its own,
standalone WC by creating a .svn/wc.db there and entering the relevant
metadata from the parent database. I haven't worked out the exact
behavior yet from the user's POV, but it would therefore mean
something along the lines of `svn sever wc_subdir; mv wc_subdir
somewhere_else`, instead of the current `mv wc_subdir somewhere_else`.
Another thing I'd very much like is to completely eliminate all
implicit tree crawls. The metadata is the working copy, unless the
user requests a forced crawl to update metadata for some reason.
This implies telling Subversion about all operations on versionned
data. We already do that for all operations, except for edits. I'd
like to change that. libsvn_wc_sqlite checks out the working copy
entirely read-only, and you have to tell svn (through something like
`svn edit file`... Yes, I have been using perforce lately) that you
are touching it, at which point it'll record that in the metadata and
flip the file to be writable.
This behavior is off by default however. The default is to crawl the
subtree rooted at cwd to work out what was edited, and to sanity check
metadata as you go. An option passed to svn checkout makes all WC
files read-only, and relies solely on the metadata to operate on the
wc, unless a particular operation forces a crawl.
Text-bases now. By default, they are stored in the metadata sqlite
database (or maybe in a separate text-base sqlite DB alongside the
regular metadata. Details.). I would however like to have a clear line
drawn in the internals of libsvn_wc_sqlite, where we could add other
behaviors in the future. Say, no text-bases and fail all operations
that require them for ultra lightweight working copies, or no
text-bases but retrieved via the ra api when needed (which opens the
way for webdav caching proxies to work their magic).
I think that libsvn_wc_sqlite addresses the issues I pointed out at
the beginning of this mail: tree crawls are minimized, inode count
goes way down, commandline tools don't find text-base dupes all over
the place, and we have a clear internal API where we can handle the
text-base storage problem cleanly. And, hopefully, most operations are
reduced to an SQL select statement, which can be blindingly fast if
the database is indexed properly.
I'm not claiming that it is perfect, it is a different tradeoff on
various points. I do think, however, that it is worth it.
You're now all invited to shoot this idea down with sensible
arguments. I will now go and make peace with myself while you assemble
the firing squad :-). Oh, and I am willing to attempt to put
changesets where my mouth is, this isn't a rant calling for someone
else to do it.
- Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Erik Huelsmann <eh...@gmail.com>.
> I'll start drawing up a more detailed design tonight, to flesh out the
> general ideas.
Let me take the opportunity to say that I hartely agree with the fact
that there's no need to 'wait' until 2.0, but that we can do this
'now' and introduce additional APIs when and where required.
Let me also take the opportunity to say that severable working copies
in libsvn_wc will probably not work as great as it looks at first
glance: there are operations which store tree changes higher up in the
tree in all subtrees and nodes (recursive copy being one of them).
These subtrees can't be severed without breaking the working copy.
Also, I hope the design of the new working copy library will help to
create better abstractions for the internal APIs. Hopefully, some of
that work can be used to re-do parts of the current libsvn_wc (since
that has its merits too IMO)!
bye,
Erik.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Mattias EngdegÄrd <ma...@virtutech.se>.
Filipe Fernandes <fe...@gmail.com> writes:
>It's true... search for '.svn' towards the top and once it's found you got
>your working copy. And it's likely very fast as you say, but the search would
>have to be done every time, and I wonder what that would be like.
I suggest you write a small test program to do just that. Most likely you will
find that it is a lot faster than you thought.
Compare this task to the traditional Unix implementation of the getcwd() call:
1. stat the current directory (".") to find out its device and inode.
2. readdir ".." to find the name corresponding to the inode just recorded.
3. remember the name as a path component
4. iterate from 1, prefixing all filenames by "../", until the root is reached
This is a lot more work than merely finding the nearest .svn directory higher
up in the hierarchy, because it requires several syscalls (including a full
readdir) on every level all the way to the root. Yet most people would not
necessarily consider a getcwd() upon opening a window to be excessive.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Filipe Fernandes <fe...@gmail.com>.
Danny van Heumen wrote:
> Like Michael Sinz already said, you only have to search for 1 specific
> directory name inside every directory you crawl, so it can be done
> pretty (very) fast.
It's true... search for '.svn' towards the top and once it's found you got
your working copy. And it's likely very fast as you say, but the search would
have to be done every time, and I wonder what that would be like.
>> TortoiseSVN could add caching to remember previously found working
>> copies for faster reporting but that seems a hell of a lot dirtier
>> than simply providing a .svn directory with info as to how many levels
>> within a working copy the current folder is situated.
> It's not that big a problem I think. It's true that they would have to
> search to the top. But in case of a working copy it's sufficient to
> remember what the root is (and special cases like ignored directories
> and such).
> Once you know the location of a root of the WC it's (almost) as easy as
> comparing the start of the current WC.
> And TortoiseSVN already uses caching (TSVNCache.exe) for the current
> directories to remember modifications. So it would only take a little
> bit more information.
Very true... remembering previous WC roots would tell us quickly if the
current folder 'is' a working copy previously referenced. But in the case
where folders are opened in the course of other work being done outside of
WCs, TortoiseSVN won't have a previous record that a WC does or doesn't exist
in a path and will check all the way to root to find out that there is none.
And it must always make this check, since it can never know for sure that I
haven't simply moved a WC into the path.
You can always tell TortoiseSVN where it should and shouldn't look to minimize
the searching and in light of this fact... as I write this sentence, I guess
it won't be so bad for Tortoise. But other (future) GUI's that report as
Tortoise does will have to compensate for the lack of a .svn folder throughout
the WC in similar ways as above.
> Considering everything I think it's a small price to pay if the '.svn'
> directories are removed.
>
> Danny
>
I personally don't like the .svn folders everywhere either (I think I'd find
it massively convenient to work without them - moving/renaming files and
folders while leaving SVN to tell me what's different instead of choking on
misplaced .svn folders). But I worry about the future of GUI's like Tortoise
having constantly to search to the top just to know what it might be looking at.
filipe
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Danny van Heumen <da...@hccnet.nl>.
Filipe Fernandes wrote:
> If there is no .svn directory n-levels down a working copy, there's no
> way for GUI programs like TortoiseSVN to know that it's looking at a
> working copy unless it traverses up towards the root and finds a .svn
> directory within the root of the working copy.
>
> Each time (every time) an explorer window is opened, TortoiseSVN would
> literally have to crawl to the top to find out if it's in a working
> copy. It's trivial to crawl to the root (unless your very deep), but it
> would have to be done every time to make sure.
Like Michael Sinz already said, you only have to search for 1 specific
directory name inside every directory you crawl, so it can be done
pretty (very) fast.
> TortoiseSVN could add caching to remember previously found working
> copies for faster reporting but that seems a hell of a lot dirtier than
> simply providing a .svn directory with info as to how many levels within
> a working copy the current folder is situated.
It's not that big a problem I think. It's true that they would have to
search to the top. But in case of a working copy it's sufficient to
remember what the root is (and special cases like ignored directories
and such).
Once you know the location of a root of the WC it's (almost) as easy as
comparing the start of the current WC.
And TortoiseSVN already uses caching (TSVNCache.exe) for the current
directories to remember modifications. So it would only take a little
bit more information.
> It's my opinion that leaving the .svn folder in place for each versioned
> directory is the small price to pay (to accomidate GUI programs like
> TortoiseSVN) in light of the serious performance increase you'd get with
> a sqlite database found in the root of the working copy for both GUI
> programs like TortoiseSVN and command line tools that come with Subversion.
The problem is that it's not just about the convenience. Leaving these
directories creates problems for some programs. Like packing programs,
they package the entire directory ... include the '.svn' directory. And
if I understand David correctly it's also a problem for programs that
run all subdirectories thinking they are plugins while '.svn' is not a
plugin.
Considering everything I think it's a small price to pay if the '.svn'
directories are removed.
Danny
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Filipe Fernandes <fe...@gmail.com>.
David Glasser wrote:
> [snip]
> If we're going the root of "no important information in .svn
> directories", then we really shouldn't require .svn directories for
> the sake of a tiny optimization.
Actually... if I understand how TortoiseSVN works... this is a very big deal
for GUI programs that visually report on changes within a working copy.
If there is no .svn directory n-levels down a working copy, there's no way for
GUI programs like TortoiseSVN to know that it's looking at a working copy
unless it traverses up towards the root and finds a .svn directory within the
root of the working copy.
Each time (every time) an explorer window is opened, TortoiseSVN would
literally have to crawl to the top to find out if it's in a working copy.
It's trivial to crawl to the root (unless your very deep), but it would have
to be done every time to make sure.
TortoiseSVN could add caching to remember previously found working copies for
faster reporting but that seems a hell of a lot dirtier than simply providing
a .svn directory with info as to how many levels within a working copy the
current folder is situated.
It's my opinion that leaving the .svn folder in place for each versioned
directory is the small price to pay (to accomidate GUI programs like
TortoiseSVN) in light of the serious performance increase you'd get with a
sqlite database found in the root of the working copy for both GUI programs
like TortoiseSVN and command line tools that come with Subversion.
filipe
ps: I heavily use TortoiseSVN, but in no way participate in it's development
so I could be seriously wrong about the above. I doubt it though ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Glasser <gl...@mit.edu>.
On 1/26/07, Danny van Heumen <da...@hccnet.nl> wrote:
> I wanted to say that, because severability isn't possible anymore, the
> structure of the WC is static. Which means that if you're 6 levels deep
> inside the WC, you can still assume that the root of the WC is 6 levels up.
> So you can take advantage of this by recording (at least) that you're 6
> levels deep (or with a relative path pointing 6 levels up) to point to
> the root of the WC.
> This wasn't possible before because of (the possibility of implicit)
> severability.
If we're going the root of "no important information in .svn
directories", then we really shouldn't require .svn directories for
the sake of a tiny optimization.
There are operations (like upgrading poorly-modularized software
(think WordPress) inside my repository) that I just can't bear to do
using the svn client which is trivial in svk, because of the .svn
directories. And then there's the OS X bundle issue, where
applications that store their data as directories have to avoid
deleting and rewriting the directory to be svn-compatible. (And
again, this is not a problem for svk's working copy.)
If we're going to rid ourselves of distributed metadata, we might as
well completely rid ourselves of it.
--dave
--
David Glasser | glasser@mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Danny van Heumen <da...@hccnet.nl>.
Michael Sinz wrote:
> While I agree that the .svn directories should still be there and
> contain at least some format and linkage information, I have a problem
> with the statement that the root would not change.
I mean the root of the WC. (sorry :P)
>
> If the linkage information is relative to the .svn directory it is in,
> then yes, I agree with this statement.
That's what I meant.
> However, if the linkage information is an absolute path, then I strongly
> disagree. I many times end up having things be renamed (moved) from one
> location to another. And in networked environments, what is
> /home/mks/project on one machine may be /nfs/fox/mks/project on another.
I agree. There's nothing certain about the environment outside the WC.
>
> (While I like and very much has used the current severability of the WC,
> I also really want server-controlled configuration and inherited
> properties, both of which end up acting against severability.)
Like you said. I think it's a cool feature. But I have nothing against
firing a single command before severing :-).
I wanted to say that, because severability isn't possible anymore, the
structure of the WC is static. Which means that if you're 6 levels deep
inside the WC, you can still assume that the root of the WC is 6 levels up.
So you can take advantage of this by recording (at least) that you're 6
levels deep (or with a relative path pointing 6 levels up) to point to
the root of the WC.
This wasn't possible before because of (the possibility of implicit)
severability.
It's even possible to use this as some sort of transition phase before
working with a WC without the '.svn' directories in each directory.
Although I don't think that will be very useful :P
I hope I made myself clear...
Danny
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Michael Sinz <Mi...@sinz.org>.
On 1/25/07, Danny van Heumen <da...@hccnet.nl> wrote:
>
> David Anderson wrote:
> > [snip]
> > First of all, if it wasn't clear in my initial mail and followups, I
> > intend libsvn_wc_sqlite to follow the API that libsvn_wc has. There
> > may be a few new functions required (for example the call to sever a
> > subtree from the wc), and possibly some changes to the libsvn_wc API,
> > which would have to be backwards-compatible changes. However, as
> > noted, some of the semantics that some users have come to rely on
> > (known location of text-bases, using .svn as the basis for knowing if
> > a directory is under version control...) would be broken by
> > libsvn_wc_sqlite, which is why it cannot entirely replace libsvn_wc
> > before 2.0.
The tree crawl (if needed) would be rather easy going upward as it is only
one direction looking for one file. (Not that we want to do any more than
needed) Relative to TSVN, this is much less than the downward crawl it
needs to do looking at multiple branches at each level.
(Assuming this idea is being implemented with 1.x compatibility in mind.)
> There will probably be a '.svn' directory, because otherwise older
> clients wouldn't recognize it as a WC. Maybe only with the format file?
> (In order to inform the user of his out-dated client.)
> In that case this '.svn' directory could hold a file which stores the
> location of the root of the WC and thus we don't need crawling. In my
> view this is now allowed because the WC isn't severable anymore so the
> root wouldn't change.)
While I agree that the .svn directories should still be there and contain at
least some format and linkage information, I have a problem with the
statement that the root would not change.
If the linkage information is relative to the .svn directory it is in, then
yes, I agree with this statement.
However, if the linkage information is an absolute path, then I strongly
disagree. I many times end up having things be renamed (moved) from one
location to another. And in networked environments, what is
/home/mks/project on one machine may be /nfs/fox/mks/project on another.
(While I like and very much has used the current severability of the WC, I
also really want server-controlled configuration and inherited properties,
both of which end up acting against severability.)
> > [snip]
> >
> > Finally, regarding `svn edit`. After thinking about it some more, it's
> > true that this feature is somewhat a separate issue to that of
> > revamping the working copy.
> FYI I don't like it. Seems much too administrative.
>
> > [snip]
> > However, I think that libsvn_wc_sqlite with tree crawls would still be
> > a huge improvement over plain libsvn_wc, even without using an
> > explicit edit operation to kill them off entirely. So, scratch
> > implementing `svn edit` for now, but keep it in mind when designing.
> Agree.
>
--
Michael Sinz Technology and Engineering Director/Consultant
"Starting Startups" mailto:Michael.Sinz@sinz.org
My place on the web http://www.sinz.org/Michael.Sinz
Re: Another working copy library
Posted by Danny van Heumen <da...@hccnet.nl>.
David Anderson wrote:
> [snip]
> First of all, if it wasn't clear in my initial mail and followups, I
> intend libsvn_wc_sqlite to follow the API that libsvn_wc has. There
> may be a few new functions required (for example the call to sever a
> subtree from the wc), and possibly some changes to the libsvn_wc API,
> which would have to be backwards-compatible changes. However, as
> noted, some of the semantics that some users have come to rely on
> (known location of text-bases, using .svn as the basis for knowing if
> a directory is under version control...) would be broken by
> libsvn_wc_sqlite, which is why it cannot entirely replace libsvn_wc
> before 2.0.
(Assuming this idea is being implemented with 1.x compatibility in mind.)
There will probably be a '.svn' directory, because otherwise older
clients wouldn't recognize it as a WC. Maybe only with the format file?
(In order to inform the user of his out-dated client.)
In that case this '.svn' directory could hold a file which stores the
location of the root of the WC and thus we don't need crawling. In my
view this is now allowed because the WC isn't severable anymore so the
root wouldn't change.)
> IOW, I think this is as much a compatibility break as FSFS was for BDB
> backend users, because the implicit promises that you could use BDB
> tools to mess with the filesystem went away. People have the choice
> whether or not to switch, and can make an informed decision based on
> the various tradeoffs.
Agree.
> [snip]
>
> Finally, regarding `svn edit`. After thinking about it some more, it's
> true that this feature is somewhat a separate issue to that of
> revamping the working copy.
FYI I don't like it. Seems much too administrative.
> [snip]
> However, I think that libsvn_wc_sqlite with tree crawls would still be
> a huge improvement over plain libsvn_wc, even without using an
> explicit edit operation to kill them off entirely. So, scratch
> implementing `svn edit` for now, but keep it in mind when designing.
Agree.
Danny
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Michael Sinz <Mi...@sinz.org>.
On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
>
> On 1/30/07, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> > On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
> >
> > > And FWIW, I am very, very strongly against any notion of 2.0.
> > > Personally, I see it as a failure in creativity. Shooting for 2.0 is a
> > > shortcut. It's a way to avoid the difficult problems. It is a way to
> > > shove development problems/maintenance at the bazillions of users that
> > > Subversion has today. Consider: 1.x clients and 2.0 servers are not
> > > compatible. 2.x clients and 1.x servers are not compatible.
> >
> > FWIW, there's no reason that we have to drop client/server compat for
> > 2.0. We've always said we weren't required to keep compat between
> > major versions, but we don't have to get rid of all of it. It's
> > perfectly reasonable IMO for us to decide to drop working copy and
> > binary compat while keeping network protocol compat.
>
> Ah. Fair enough. I guess it is conceivable to have a 2.0 that revs
> only the library APIs (e.g. removing cruft), but is otherwise
> *exactly* the same to the user.
>
> I still think it will freak people out, and would want to avoid 2.0 at
> all costs, but hey... you're right in that it doesn't mean incompat
> clients/servers.
I agree that having the client library API be reved (and WC incompatibility)
at the 2.0 revision would not require a network layer change. In fact,
it would be best (IMHO) if it did not.
This thread brought on a flashback to 1989-1991 for me with the talk of
"version 2.0 breaks everything" as that was the talk in the AmigaOS
development group - 1.4 was what we were building and it was going
to be compatible but 2.0 was not. We tried to explain the rules, etc.
Marketing and common sense came and changed that - 2.0 (2.0.4) was
a major change/enhancement to the OS and yet still provided a
significant change to many parts of the system. We just had lots of
compatibility shims and tricks we had to play.
Having lived through a number of system updates/replacement projects,
it would make for a much better adoption process to have the break
be in one spot only rather than drastically across the board. Other than
WC incompatibilities, everything else should be possible to have
compatibility shims to some level. (Well, if we are lucky it should be)
--
Michael Sinz Technology and Engineering Director/Consultant
"Starting Startups" mailto:Michael.Sinz@sinz.org
My place on the web http://www.sinz.org/Michael.Sinz
Re: Another working copy library
Posted by Greg Stein <gs...@lyra.org>.
On 1/30/07, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
>
> > And FWIW, I am very, very strongly against any notion of 2.0.
> > Personally, I see it as a failure in creativity. Shooting for 2.0 is a
> > shortcut. It's a way to avoid the difficult problems. It is a way to
> > shove development problems/maintenance at the bazillions of users that
> > Subversion has today. Consider: 1.x clients and 2.0 servers are not
> > compatible. 2.x clients and 1.x servers are not compatible.
>
> FWIW, there's no reason that we have to drop client/server compat for
> 2.0. We've always said we weren't required to keep compat between
> major versions, but we don't have to get rid of all of it. It's
> perfectly reasonable IMO for us to decide to drop working copy and
> binary compat while keeping network protocol compat.
Ah. Fair enough. I guess it is conceivable to have a 2.0 that revs
only the library APIs (e.g. removing cruft), but is otherwise
*exactly* the same to the user.
I still think it will freak people out, and would want to avoid 2.0 at
all costs, but hey... you're right in that it doesn't mean incompat
clients/servers.
>...
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
> And FWIW, I am very, very strongly against any notion of 2.0.
> Personally, I see it as a failure in creativity. Shooting for 2.0 is a
> shortcut. It's a way to avoid the difficult problems. It is a way to
> shove development problems/maintenance at the bazillions of users that
> Subversion has today. Consider: 1.x clients and 2.0 servers are not
> compatible. 2.x clients and 1.x servers are not compatible.
FWIW, there's no reason that we have to drop client/server compat for
2.0. We've always said we weren't required to keep compat between
major versions, but we don't have to get rid of all of it. It's
perfectly reasonable IMO for us to decide to drop working copy and
binary compat while keeping network protocol compat.
Not that I'm arguing for a 2.0, I just wouldn't want "the clients will
be incompatible with the servers" to be the reason for not doing one.
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by "C. Michael Pilato" <cm...@collab.net>.
Ben Collins-Sussman wrote:
> On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
>
>> And FWIW, I am very, very strongly against any notion of 2.0.
>> Personally, I see it as a failure in creativity. Shooting for 2.0 is a
>> shortcut. It's a way to avoid the difficult problems. It is a way to
>> shove development problems/maintenance at the bazillions of users that
>> Subversion has today. Consider: 1.x clients and 2.0 servers are not
>> compatible. 2.x clients and 1.x servers are not compatible. Each time
>> a user wants to check something out, they will need to know the
>> version of the server. Holy shit will that suck. Big time. Badly. One
>> month of extra development to ensure 1.x compatibility, or a bazillion
>> man-months of productivity loss due to a major version change. Eesh.
>> Doesn't seem like a fair tradeoff. Hey... to be fair, it's true that
>> I'm not personally spending that extra dev time, but I don't think
>> that means the point is any less valid. And if/where I get to assign
>> or volunteer time for svn dev? It'll be on 1.x. I think that the
>> *concept* of 2.0 is just giving up.
>
> I agree that if we define 2.0 to mean "break all compatibility,
> everywhere", then yes... it will be a huge PITA for users. But
> presumably, there's some big net gain that the users get in exchange
> for their forced-upgrade pain, no? Isn't that sort of the point.
>
> While I agree with your sentiment above, it also looks like an excuse
> to never, ever, ever release 2.0. Your argument above could apply to
> pretty much every radical feature or design-change that ever gets
> proposed in the future, couldn't it?
>
> So I'm curious, Greg -- in your mind, what *would* justify a 2.0?
I've always kinda thought of "2.0" as the point where we finally say two things:
* we've had it with duct-taping features onto our existing repository
backends, and so we're ready to start clean with them, sans schema
compatibility concerns.
* it's time to really drop our deprecated APIs and reset our function
version counters (s/svn_client_commit43/svn_client_commit/).
This has nothing to do with client-server compatibility, mind you. It
simply means that folks have to dump and load their repositories. It's a
one-time bit of pain that brings all the things we'd want a new set of
repository backends to bring. Yes, there are always those folks using
ra-local access around which we have to dance and throw flower petals, but
those folks just have to suck it up and deal this one time.
Until then, we're stuck either trying to make sure that all our backends can
reasonable support the same features (lowest common denominator scenario),
or that we explicitly allow them to differ functionally and we somehow
communicate that gracefully all the way back to the client ("svn:error: The
repository backend chosen for you by your Subversion administrator and over
which you have no control doesn't support atomic moves. Have a nice day!").
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: Another working copy library
Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 1/30/07, Greg Stein <gs...@lyra.org> wrote:
> And FWIW, I am very, very strongly against any notion of 2.0.
> Personally, I see it as a failure in creativity. Shooting for 2.0 is a
> shortcut. It's a way to avoid the difficult problems. It is a way to
> shove development problems/maintenance at the bazillions of users that
> Subversion has today. Consider: 1.x clients and 2.0 servers are not
> compatible. 2.x clients and 1.x servers are not compatible. Each time
> a user wants to check something out, they will need to know the
> version of the server. Holy shit will that suck. Big time. Badly. One
> month of extra development to ensure 1.x compatibility, or a bazillion
> man-months of productivity loss due to a major version change. Eesh.
> Doesn't seem like a fair tradeoff. Hey... to be fair, it's true that
> I'm not personally spending that extra dev time, but I don't think
> that means the point is any less valid. And if/where I get to assign
> or volunteer time for svn dev? It'll be on 1.x. I think that the
> *concept* of 2.0 is just giving up.
I agree that if we define 2.0 to mean "break all compatibility,
everywhere", then yes... it will be a huge PITA for users. But
presumably, there's some big net gain that the users get in exchange
for their forced-upgrade pain, no? Isn't that sort of the point.
While I agree with your sentiment above, it also looks like an excuse
to never, ever, ever release 2.0. Your argument above could apply to
pretty much every radical feature or design-change that ever gets
proposed in the future, couldn't it?
So I'm curious, Greg -- in your mind, what *would* justify a 2.0?
> A new working copy library would be awesome. Start with code, then
> figure out the middle ground for 1.x. At some future time, 2.x can
> iterate to improve and to shed dead weight.
>
If svn 1.X keeps coming out with huge new features (merge tracking,
totally redesigned WC, revlog repository, some optional degree of
distributed version control, ...) ... and then we release an
incompatible 2.0 which just "sheds dead weight" and implements things
more efficiently... is that worth all of the users' pain in upgrading?
My impression is that people would be only willing to upgrade for
earth-shaking features, not speed optimizations.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Jan 30, 2007 at 12:36:22AM -0800, Greg Stein wrote:
> (and why does revlog mean 2.0? isn't that just another backend like
> bdb vs fsfs?)
>
Revlog shouldn't mean 2.0, unless there's something really basic that
I'm missing.
Regards,
Malcolm
Re: Another working copy library
Posted by Greg Stein <gs...@lyra.org>.
On 1/22/07, Peter Lundblad <pl...@google.com> wrote:
> Peter Samuelson writes:
> >
> > [Peter Lundblad]
> > > Another thing is that the API is rather specific to the current way
> > > of working.
> > [...]
> > > I suggest we instead create a new API and then try to implement it in
> > > terms of the old one.
> >
> > Usually when you rev an API you do the opposite: implement the new API
> > directly, and reimplement the old API on top of the new one. So I'm
> > curious about why you think this should not be handled that way.
> >
> Because in this case, we are not talking about API revision in the usual sense.
> We're talking about a more or less completely new set of APIs.
> Reworking the old (err, current) WC code in terms of a new API and then trying
> to reimplement it on top of that just seems to be a lot of hard work
> to me. Normally, compatibility wrappers are very trivial, but I assume
> these will not.
Well... more specifically: I saw Peter Lundblad's suggestion as
"create a new API based on our current understanding, but implemented
the same as today." IOW, we take everything that we've learned, take
actual usage, and create a new API. That API is then implemented in
terms of the old/current API and *code* to ensure correctness (or as
close to it; there may be some coupling across the wc APIs that would
surface in this rebuild scenario).
We could then migrate all code to the new API, and then in a third
step reimplement that API with new designs/schemes/whatever.
This scenario works well to ensure compatibility of the new API, but
it has drawbacks:
1) how do you define the new API? generally, you need the new
implementation to drive your efforts at creating that new API. IOW,
you need step 3 to be completed, then you fill in the other bits.
2) this approach does not solve the problem of supporting the classic
API in terms of the new implementation.
These two problems need to be solved for a successful migration. I
believe that the new implementation is the right place to start. Then
examine how to squeeze that into the current implementation, leading
to a definition of a middle ground... a new API... which encompasses
both old and new implementations. Then you hobble the new
implementation to support the old API as appropriate. Ideally, this is
done in such a way that if *only* new users interact with the working
copy on disk, then you're golden. Only the old guys get sucked with
the crap.
So, imo: start with a blue sky. Build it. Then start the compromise
and the reaching of middle ground. Record those compromises for things
to remove during the 2.0 rebuild.
And FWIW, I am very, very strongly against any notion of 2.0.
Personally, I see it as a failure in creativity. Shooting for 2.0 is a
shortcut. It's a way to avoid the difficult problems. It is a way to
shove development problems/maintenance at the bazillions of users that
Subversion has today. Consider: 1.x clients and 2.0 servers are not
compatible. 2.x clients and 1.x servers are not compatible. Each time
a user wants to check something out, they will need to know the
version of the server. Holy shit will that suck. Big time. Badly. One
month of extra development to ensure 1.x compatibility, or a bazillion
man-months of productivity loss due to a major version change. Eesh.
Doesn't seem like a fair tradeoff. Hey... to be fair, it's true that
I'm not personally spending that extra dev time, but I don't think
that means the point is any less valid. And if/where I get to assign
or volunteer time for svn dev? It'll be on 1.x. I think that the
*concept* of 2.0 is just giving up.
(and why does revlog mean 2.0? isn't that just another backend like
bdb vs fsfs?)
A new working copy library would be awesome. Start with code, then
figure out the middle ground for 1.x. At some future time, 2.x can
iterate to improve and to shed dead weight.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Peter Lundblad <pl...@google.com>.
Peter Samuelson writes:
>
> [Peter Lundblad]
> > Another thing is that the API is rather specific to the current way
> > of working.
> [...]
> > I suggest we instead create a new API and then try to implement it in
> > terms of the old one.
>
> Usually when you rev an API you do the opposite: implement the new API
> directly, and reimplement the old API on top of the new one. So I'm
> curious about why you think this should not be handled that way.
>
Because in this case, we are not talking about API revision in the usual sense.
We're talking about a more or less completely new set of APIs.
Reworking the old (err, current) WC code in terms of a new API and then trying
to reimplement it on top of that just seems to be a lot of hard work
to me. Normally, compatibility wrappers are very trivial, but I assume
these will not.
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Peter Samuelson <pe...@p12n.org>.
[Peter Lundblad]
> Another thing is that the API is rather specific to the current way
> of working.
[...]
> I suggest we instead create a new API and then try to implement it in
> terms of the old one.
Usually when you rev an API you do the opposite: implement the new API
directly, and reimplement the old API on top of the new one. So I'm
curious about why you think this should not be handled that way.
By the way, concerning wc severability: I use that feature, it's
important to me, but I would not have a problem with having to run some
'svn sever' step explicitly.
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Fri, Jan 19, 2007 at 11:44:24AM +0100, Peter Lundblad wrote:
> So, what am I trying to say? I am positive to this idea in general, but
> I think we need to consider it a part of a movement towards 2.0.
> I think we should create a completely new API and start using it in our
> code and create a wrapper implementing the new API in terms of the existing
> libsvn_wc API.
On Fri, Jan 19, 2007 at 01:25:48PM +0100, Erik Huelsmann wrote:
> I think it's great to work on a new working copy
> library, but I think we don't really have fully defined semantics for
> a working copy library just yet.
>
Just to say that I think those two paragraphs capture my thoughts on
this too.
Regards,
Malcolm
Re: Another working copy library
Posted by Erik Huelsmann <eh...@gmail.com>.
[ snip ]
> So, what am I trying to say? I am positive to this idea in general, but
> I think we need to consider it a part of a movement towards 2.0.
> I think we should create a completely new API and start using it in our
> code and create a wrapper implementing the new API in terms of the existing
> libsvn_wc API.
I'd like to add that I agree that a new working copy model would allow
us to start a migration towards 2.0. Personally, I'd like to make
'call it 2.0 and ditch the old stuff' a separate decision from whether
or not to create a completely new WC access API: If/when we make
mistakes in the design, but release the first version(s) within the
1.0 cycle, we can ditch the mistakes when finally moving to 2.0 with a
solidified, tested and proven new WC API.
> > I'll start drawing up a more detailed design tonight, to flesh out the
> > general ideas.
> >
> Cool! Looking forward to reading it.
So am I. I'd like to point out that there should be a functional
discussion before we actually have the design discussion though: The
current library happens to do some things in ways which just happened
to be implemented in a certain way or inherited from the editor API.
I'm referring to the way tree changes are treated and especially the
way updates and merges interact with local tree changes: Should an
update of a locally replaced file merge the changes, or is it really a
different object and should the tree change itself be marked as a
'C'onflict? If we have conflicting tree changes, how do we want the
library to act upon them?
In other words, I think it's great to work on a new working copy
library, but I think we don't really have fully defined semantics for
a working copy library just yet.
Bye,
Erik.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Peter Lundblad <pl...@google.com>.
Hi,
I have real concerns with this new WC implementation idea, but I still think it
is something we should do, in a slightly different way than you propose...
David Anderson writes:
> The first is that this is a 2.0 feature. I disagree for several reasons.
>
> First of all, if it wasn't clear in my initial mail and followups, I
> intend libsvn_wc_sqlite to follow the API that libsvn_wc has. There
> may be a few new functions required (for example the call to sever a
> subtree from the wc), and possibly some changes to the libsvn_wc API,
> which would have to be backwards-compatible changes. However, as
> noted, some of the semantics that some users have come to rely on
> (known location of text-bases, using .svn as the basis for knowing if
> a directory is under version control...) would be broken by
> libsvn_wc_sqlite, which is why it cannot entirely replace libsvn_wc
> before 2.0.
>
We never promised that the internal format would be the same throughout
1.x, so people relying on that are doomed. We've had several updates
to the internal format, including the ones for 1.4. The API needs to stay
compatible, though.
> That, in my opinion, is not a strong enough reason to push off
> addressing wc issues until 2.0. For that matter, we still don't know
So, we know we have some big-project users that are being hurt by our
current performance. I am also pretty sure there are lots off not-so-big
project users that are quite happy with the current implementation.
The question is to what extent a certain user category should be allowed
to add costs for the project *see below about maintainence costs).
> exactly what we want and don't want in 2.0, nor when we will start
> working on it. I am not prepared to put this off indefinitely until
> the hypothetical time where we decide that we've had it with 1.x. That
> watershed moment isn't clearly defined enough for me to rely on it.
>
OTOH, we are the ones who can start defining a roadmap for 2.0 if we want to.
Starting things that are more or less 2.0 things now (WC redesign,
FS redesign, ..., without a clear vision about 2.0 wisl cause us to carry
the old compatibility bagage forever. Most (all?) users will use
the new stuff and the old stuff will bitrot, but still be halfheartedly
maintained for theoretical compatibility. I am not stopping you from designing
a new WC format (in fact I want to do the oposite), but we do need to
consider the big picture.
> IOW, I think this is as much a compatibility break as FSFS was for BDB
> backend users, because the implicit promises that you could use BDB
> tools to mess with the filesystem went away. People have the choice
> whether or not to switch, and can make an informed decision based on
> the various tradeoffs.
>
Theoretically this could be the case. The big difference, though, is that
for the filesystem, there was a much cleaner API abstraction.
I just went through the 150 K svn_wc.h to see whether my feeling was right,
and I am still convinced that the WC API has accumulated so much low-level
crutf that trying to reimplement it in a completely different format -
with different tradeoffs and requirements will be a real challenge.
First off all, how do we know that the new library is compatible with the
old one? This is a very complex piece of code and some of the APIs
have really quirky semantics. I guess a solution to this would be to write
a real test suite for the WC library and not just rely on regression tests
of the svn commandline client for that.
Another thing is that the API is rather specific to the current way
of working. Would the adm directory locking mechanism be appropriate for
this type of format. The svn_wc_entry_t struct exposes a lot of
implementation details that it shouldn't and the entries caching in
memory is actually *hardcoded* in the API. There are other examples of
things I'd rather not be constrained by in a new WC format design.
I suggest we instead create a new API and then try to implement it
in terms of the old one. The old API will essentially be frozen and our
own code will thereby start using the new one. I admit that this might
cause some tasks to be suboptimally implemented for the old WC and we
need, to some extent, take that into account when designing the API.
OTOH, if users complain about perf regressions, we can always recommend
they switch to the new WC format without forcing them to;)
New features may have to be reflected in the old WC library, but we can add
new private (__ named) APIs to not expose new APIs outside our own libs.
> Which brings me to the maintenance burden issue that was raised. As I
> have said, I am willing to put changesets where my mouth is and make
> this happen. It seems a few other people are also willing to help out
> doing this. I am very much against needless maintenance burdens, but I
So, you are talking about doing the initial implementation which is not the
same as maintainence. The old code also needs some care, but who will want
to put effort into that when the new shiny lib is available? When adding
new features, we need to consider whether to make them available for those
who didn't switch yet.
We now have 4 RA layers, 2 FS backends and we would then have 2 WC libs as
well. This becomes 16 combinations for testing and when most people
switch to the new lib things that don't work in the old one will probably
turn up later in the dev cycle leading to problems. These are real costs
for a complex part of our code base that we shouldn't underestimate.
I am ready to accept this extra cost in order to go forward, but as I said
before, if we do this, we really need to start focusing on 2.0 to not
keep this cost forever.
> Regarding the proposed storage mechanism: I'm with Justin on the not
> storing anything outside the working copy by default. I like my
> self-contained working copies that I can delete without "detaching"
> them or some such nonsense. However, there are cases where storing the
We once hard-coded the location of admin data, which turned out to be a bad
thing for certain dev environments on certain platforms. Let's not redo
that mistake...
> want stuff in ~/.subversion, then put the metadata there and symlink,
> and you're golden.
...or for that matter encourage people to mess with the metada (location)
by hand. Also, let's be a bit more user friendly than that.
>
> However, I think that libsvn_wc_sqlite with tree crawls would still be
> a huge improvement over plain libsvn_wc, even without using an
...
I think you are right, but guessing is no good way of profiling.
A prototype implementation will tell for sure.
So, what am I trying to say? I am positive to this idea in general, but
I think we need to consider it a part of a movement towards 2.0.
I think we should create a completely new API and start using it in our
code and create a wrapper implementing the new API in terms of the existing
libsvn_wc API.
> I'll start drawing up a more detailed design tonight, to flesh out the
> general ideas.
>
Cool! Looking forward to reading it.
Regards,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Jared Hardy <ja...@gmail.com>.
Excuse me butting in, because I'm not (yet) a committer, but a similar
discussion of svn client shortcomings was brought up in the user list,
and I thought some of the points there are pertinent. I have even
declared that I am personally giving up on using svn clients, and I am
moving my company to all use SVK as the main (or only) client, due to
its earlier implementation of some of the features being discussed
here.
On 1/17/07, David Anderson <da...@natulte.net> wrote:
> The first is that this is a 2.0 feature. I disagree for several reasons.
I don't care what version number these changes come in. I wont be
using any svn client version until a central WC cache of some sort is
implemented. Updates are just too painful with large NTFS tree crawls
right now. Commits are worse. I need to hack SVK to add Lock
capability, but once that's done, it has everything I need, through
its "svk mirror" implementation.
> IOW, I think this is as much a compatibility break as FSFS was for BDB
> backend users
I like that thought. While new options always add maintenance
overhead, such a diverse user base requires diverse customization
options.
> Which brings me to the maintenance burden issue that was raised. As I
> have said, I am willing to put changesets where my mouth is and make
> this happen.
I am currently working on an internal implementation of changesets.
Right now I am structuring each "changeset" as a named local branch of
an SVK mirror branch. All "changeset additions" are commits to that
branch. At the time of changeset commit, the changeset branch is just
smerge'd with the mirror branch. To me, changesets are just locally
administered patches, or "commit file lists" in the most trivial case,
with some nice labeling and tracking features, until time of commit.
I'm still interested to hear other's definition of "changeset".
> Regarding the proposed storage mechanism: I'm with Justin on the not
> storing anything outside the working copy by default. I like my
> self-contained working copies that I can delete without "detaching"
> them or some such nonsense.
I think David Glasser already mentioned, SVK can go both ways (~/.svk
or trunk/.svk). I don't mind the time it takes crawling up parents in
a tree to find the WC (this is always a straight line, and much faster
than the endless forking down crawl that is used now). I do like the
option of a one-stop-shop WC. I even hacked SVK locally to always
refer to a system env var ${SVKPATH} to look for the .svk WC store --
so that I can have a per-machine WC cache instead of a per-user WC
cache. As I said, I like options.
I think the easiest work-around to having a separate "detach"
command is just defining the command "svn mv trunk new-trunk-pos", or
even "svn mv folder new-folder-outside-WC". The first case would
change the local path reference for the "trunk" WC entry, but not
change anything in the repository or status otherwise. The second case
command would be just like the "svn sever blah new-blah" command you
mentioned before (which is a bit close to "svn server" in appearance
for my taste..).
> complicates the design for no net improvement that I can see. If you
> want stuff in ~/.subversion, then put the metadata there and symlink,
> and you're golden.
This "symlink option" eliminates the point of having a central
(per-user or per-machine instead of per-WC) cache in the first place
-- preventing the constant "crawl up until .svn found" check,
especially in GUIs like TortoiseSVN. This is much better and faster
than the "crawl and status down every fork" that TortoiseSVN does now,
but it is not the /optimal/ case for WC path search.
> Finally, regarding `svn edit`. After thinking about it some more, it's
> true that this feature is somewhat a separate issue to that of
> revamping the working copy.
One work-around to not having an explicit "svn edit" built-in might be
an "svn update --set-read-only ." option of some sort. Then I could
write wrapper scripts that use some locally maintained text list of
all "edit touched files", and chmod +w them after any update or lock.
I would chmod -w the files, and delete them from the text list, any
time they are included in a commit. Of course, this is a local hack
that wouldn't follow major "svn mv" or "svn sever" operations easily
(more wrapper scripts required), so "svn edit" is still preferable.
> I'll start drawing up a more detailed design tonight, to flesh out the
> general ideas.
I almost forgot -- THANK YOU! I hope this helped.
:) Jared
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Barry Scott <ba...@barrys-emacs.org>.
I'd love to see an improved WC API and implementation that makes GUI
use cases perform.
From pysvn Workbench's point of view the main API issue is that I
need to
get all the metadata for every file in a directory as efficiently as
possible.
I call svn_client_status which provides half the info I need in one
call.
But I cannot get the properties in an efficient way using the
svn_client API.
I currently read the props info directly out of .svn bypassing the
svn_client
API as it is incredibly slow.
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Anderson <da...@natulte.net>.
[Making this a general reply to the thread]
So far, I see cautious approval for this proposal on the thread. I
like that. That's cool, and I think I will start work on a design and
implementation as soon as my free time permits (which should by
mid-february).
Addressing the issues that have been raised now.
The first is that this is a 2.0 feature. I disagree for several reasons.
First of all, if it wasn't clear in my initial mail and followups, I
intend libsvn_wc_sqlite to follow the API that libsvn_wc has. There
may be a few new functions required (for example the call to sever a
subtree from the wc), and possibly some changes to the libsvn_wc API,
which would have to be backwards-compatible changes. However, as
noted, some of the semantics that some users have come to rely on
(known location of text-bases, using .svn as the basis for knowing if
a directory is under version control...) would be broken by
libsvn_wc_sqlite, which is why it cannot entirely replace libsvn_wc
before 2.0.
That, in my opinion, is not a strong enough reason to push off
addressing wc issues until 2.0. For that matter, we still don't know
exactly what we want and don't want in 2.0, nor when we will start
working on it. I am not prepared to put this off indefinitely until
the hypothetical time where we decide that we've had it with 1.x. That
watershed moment isn't clearly defined enough for me to rely on it.
Because I think that it does address real issues that have come up
with libsvn_wc, I think it should be implemented sooner rather than
pushed off to an uncertain future. As it has been noted, because some
of the internal behavior people have come to expect from libsvn_wc,
libsvn_wc_sqlite would break their expectations. That is why I want it
to be a separate implementation that can be selected at runtime.
Either you stay with libsvn_wc for your checkouts and keep existing
semantics, or you use libsvn_wc_sqlite and must adapt to the new
implicit promises it makes. Until we break compatibility for good in
2.0, you have a choice of staying with the known, or going with the
new.
IOW, I think this is as much a compatibility break as FSFS was for BDB
backend users, because the implicit promises that you could use BDB
tools to mess with the filesystem went away. People have the choice
whether or not to switch, and can make an informed decision based on
the various tradeoffs.
Which brings me to the maintenance burden issue that was raised. As I
have said, I am willing to put changesets where my mouth is and make
this happen. It seems a few other people are also willing to help out
doing this. I am very much against needless maintenance burdens, but I
believe that in this case the extra code is really, really worth it.
As much as maintaining ra_dav and ra_svn to cater for two different
sets of user constraints. And defaulting to use libsvn_wc will keep
users safe from shifting semantics until they decide to go there.
Regarding the proposed storage mechanism: I'm with Justin on the not
storing anything outside the working copy by default. I like my
self-contained working copies that I can delete without "detaching"
them or some such nonsense. However, there are cases where storing the
working copy metadata elsewhere could be useful (off the top of my
head, put the metadata and text-bases on a local drive, but keep the
source in an nfs homedir). This doesn't require complex designs, as it
can be achieved trivially by symlinking .svn to somewhere else. We can
even support it during a checkout if you balk at the extra commands
needed to shuffle stuff around, and I'm sure a change that also
supports using win32 shortcuts or what have you could be figured out
for the same end result.
I think that's about as far as I care to go for movable metadata
stores. I don't care about sharing metadata (other than text-bases,
which is a separate issue IMO) between working copies, it just
complicates the design for no net improvement that I can see. If you
want stuff in ~/.subversion, then put the metadata there and symlink,
and you're golden.
Finally, regarding `svn edit`. After thinking about it some more, it's
true that this feature is somewhat a separate issue to that of
revamping the working copy.
However, a Malcolm pointed out, it should be considered in the design,
so that it can be done later. There will already be a big improvement
coming from being able to run a couple of select statements through
sqlite, rather than locking and reading N different files all over the
place, but a crawl is still a lot of calls to readdir and stat, which
become non-negligeable in some cases (like a working copy on a
slightly slow nfs mount, where that translates almost directly into
RPC overhead).
However, I think that libsvn_wc_sqlite with tree crawls would still be
a huge improvement over plain libsvn_wc, even without using an
explicit edit operation to kill them off entirely. So, scratch
implementing `svn edit` for now, but keep it in mind when designing.
I'll start drawing up a more detailed design tonight, to flesh out the
general ideas.
- Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Glasser <gl...@mit.edu>.
On 1/17/07, Malcolm Rowe <ma...@farside.org.uk> wrote:
> * I don't think we should try providing two libsvn_wc implementations.
> Either libsvn_wc_sqlite can implement all the public svn_wc functions
> or it can't. If the former is true, we should just replace the
> implementation. If the latter, I don't see how we can make this usable
> without declaring Subversion 2.0 (in which case, see the former).
One of way of looking at it is that David's proposed system wouldn't
be a second implementation of the libsvn_wc interface (like fsfs vs
bdb), but a second "checkout storage" library that libsvn_client knows
how to deal with. Although that might just end up making
libsvn_client too complicated.
(For what it's worth, I think this is a great idea to work on; my only
concern is that if this ends up becoming svn 2.0 anyway, we should
consider whether or not it makes more sense to look towards a
checkout-metadata-as-partial-repository method. But that's a longer
term concern anyway.)
--dave
--
David Glasser | glasser@mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Peter Lundblad <pl...@google.com>.
I agree to much of what Malcolm says. Some further comments below:
Malcolm Rowe writes:
> On Tue, Jan 16, 2007 at 11:36:58PM -0800, David Anderson wrote:
> > [good stuff]
>
> * I don't think we should try providing two libsvn_wc implementations.
Completely agree. That maintainance burden is too high!
> Either libsvn_wc_sqlite can implement all the public svn_wc functions
> or it can't. If the former is true, we should just replace the
> implementation. If the latter, I don't see how we can make this usable
> without declaring Subversion 2.0 (in which case, see the former).
>
I don't think a reasonable new API should try to support the old one. IMO, it
is just too low-level for that. To me, this is a 2.0 thing.
> * You mention that we aren't seeing any movement on optional textbases
> due to the state of libsvn_wc. From what I understand, it's not just
> the state of the implementation, but the assumptions by the _users_
> of libsvn_wc as to how the implementation works. I understood that
> the next step in fixing those problems should be to remove some of
> those assumptions from the current users. That's still true even if
> you replace libsvn_wc.
>
Yep, libsvn_client also has assumptions of text bases being available.
Back when I was thinking of solving the optional textbase issue, I was
loosly thinking of adding callbacks so that libsvn_wc could indirectly
call into libsvn_ra. This would be compatible as long as you didn't use
the new feature. That would probably be a bit messy, though...
> * I like the design of using a single (SQLite) database in the root of
> the working copy. I agree that we'd need a severability operation for
> those people who need to use it, but that we can make that explicit.
> From what I recall, that was the same conclusion some of us reached
> at the Summit in October (though I can't remember who was involved in
> the conversation).
>
I think we should consider allowing all WC metadata to be in a central
store somewhere. Say you have your working files on NFS, then you could
have your metadata on local disk for performance. That's a thing we can
flesh out later, though. I agree that central storage (per WC root or
overall) is necessary.
> * I think the 'svn edit' mode of operation shows some promise, but I
> think we should put off implementation until we have the current mode
> working well. We should take it into account in the design though.
If we get rid of entries reading and WC locking/unlocking for every dir,
then the crawling shouldn't cost much more for svn status than for calling
make for an incremental build. So, I am not sure we need this feature.
Typical projects who have slow svn status would have slow incremental builds
which they might want to solve anyway. But I'm not closing the door
entirely.
>
>
> I think that the next steps should be to write down the problems we're
> trying to solve (and those we aren't) and come up with a concrete design
> that we can validate against those requirements. I'd also like to know:
>
> - how we're going to solve the assumptions made by users of libsvn_wc
> in our codebase (I don't think we need to worry about assumptions
> made by other users). For example, do we introduce operations to
> encapsulate access to the text-base files.
>
As long as we are in 1.x land, we need to be backwards compatible. That's
a promise we made.
> Finally: I'd love to help. I'm not sure how much time I'll have though.
>
+1, without any actual promises on my side, though;)
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Jan 16, 2007 at 11:36:58PM -0800, David Anderson wrote:
> [good stuff]
* I don't think we should try providing two libsvn_wc implementations.
Either libsvn_wc_sqlite can implement all the public svn_wc functions
or it can't. If the former is true, we should just replace the
implementation. If the latter, I don't see how we can make this usable
without declaring Subversion 2.0 (in which case, see the former).
* You mention that we aren't seeing any movement on optional textbases
due to the state of libsvn_wc. From what I understand, it's not just
the state of the implementation, but the assumptions by the _users_
of libsvn_wc as to how the implementation works. I understood that
the next step in fixing those problems should be to remove some of
those assumptions from the current users. That's still true even if
you replace libsvn_wc.
* I like the design of using a single (SQLite) database in the root of
the working copy. I agree that we'd need a severability operation for
those people who need to use it, but that we can make that explicit.
From what I recall, that was the same conclusion some of us reached
at the Summit in October (though I can't remember who was involved in
the conversation).
* I think the 'svn edit' mode of operation shows some promise, but I
think we should put off implementation until we have the current mode
working well. We should take it into account in the design though.
I think that the next steps should be to write down the problems we're
trying to solve (and those we aren't) and come up with a concrete design
that we can validate against those requirements. I'd also like to know:
- how we're going to solve the assumptions made by users of libsvn_wc
in our codebase (I don't think we need to worry about assumptions
made by other users). For example, do we introduce operations to
encapsulate access to the text-base files.
- what we can learn from how other implementations work. SVK has its
own working copy storage, for example.
Finally: I'd love to help. I'm not sure how much time I'll have though.
Regards,
Malcolm
Re: Another working copy library
Posted by Sander Striker <st...@apache.org>.
David Anderson wrote:
> I've been kicking the thought around for a while now, so I'll get it
> out here in the open.
>
> I think we all know about the "organic" growth of libsvn_wc. As more
> large projects like gcc or KDE adopt Subversion, they are starting to
> also run into scalability issues with the working copy library that
> cannot be resolved easily (not to mention companies that have groaned
> a little about this).
Yep, large source trees are definitely an issue; operations take a lot
more time in a large tree than in a small tree, even if the number of
changes in the small tree is larger.
> So, I want to break libsvn_wc.
+1!
[...]
> You're now all invited to shoot this idea down with sensible
> arguments. I will now go and make peace with myself while you assemble
> the firing squad :-). Oh, and I am willing to attempt to put
> changesets where my mouth is, this isn't a rant calling for someone
> else to do it.
Go for it!
Sander
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Anderson <da...@natulte.net>.
On 1/17/07, Ph. Marek <ph...@bmlv.gv.at> wrote:
> > I think that libsvn_wc_sqlite addresses the issues I pointed out at
> > the beginning of this mail: tree crawls are minimized,
> If you can get the indizes in a sequential chunk, it may be worth it.
> Else you'll get the harddisk seeking around, too (although better, I admit).
So SQLite is not as efficient as writing our own raw database format
fine-tuned for svn, or for that matter, our own OS-level filesystem
specially built to handle svn working copies. I can live with that
:-).
> > commandline tools don't find text-base dupes all over
> > the place,
> As long as you store them in a BLOB or similar, why not? grep happily looks
> into binary files, just to give you the filename.
So it'll tell me wc.db matches, once; rather than the current
behavior, which is to give me twice the number of actual results I
want. That's already a big bonus. If we add a zlib svn_stream in and
out of the text-base DB, we also might save a little disk space, and
we eliminate even the single binary file match.
> And if you use "grep --exclude *.svn*" it doesn't matter if there's one file
> or 1000.
Fair enough. That's still 1000 times less work, and one less
commandline argument I need to pass the many times I want to grep over
an svn checkout.
> > and we have a clear internal API where we can handle the
> > text-base storage problem cleanly. And, hopefully, most operations are
> > reduced to an SQL select statement, which can be blindingly fast if
> > the database is indexed properly.
> "If the database is indexed properly". So it will have some
> storage-space-cost.
Most optimizations do.
> I don't want to be seen as outright against that idea - it surely has it's
> merits. I just don't know whether it makes sense to store multi-GB in a
> database, when there's a filesystem available. It feels a bit like
> file-in-database-on-nfs-mount-on-loopback-mounted-file-on-samba-share, if you
> get what I mean ;-)
I completely understand that feeling. Note outright that I mentionned
that I want a clean internal API where alternative text-base handling
mechanisms can be added as time goes/needs are felt. The database
storage solution just seemed obvious, if we have a SQLite database
hanging around and open anyway.
It has a few other advantages over storing as regular files: less
inodes are used by storing them all together, less os-level metadata
is needed to store these files (which we care about only for their
content), and tools that crawl the working copy will be slightly less
confusing when used.
> I think that, when such a big thing is being done, it may be good to break a
> bit more -- don't store local text bases.
> That saves us 50% of storage space and grep is happy.
> Use partial-MD5-hashes to check for modifications (like fsvs does), and if
> there's a ra call "ra_get_file_ranges" fsvs would be happy, too :-)
Note my mention of a clean internal API where additional text-base
handling mechanisms can be added. One would be the current behavior,
store them all locally. Pros, more operations available without
hitting the network; Cons, big wc == lots of disk space wasted.
Another would be, say, always grab from the network. Pros, almost zero
space overhead in the WC, and you're good if you're on a local network
or behind a caching proxy, or only ever updating; Cons, if you're not,
your working copy will be the suck slow as it pounds the network.
Another might be to put the text-bases into a configurable location on
the local drive, so that multiple working copies of the same project
can share them as they come and go. At this point, I don't have any
solid plans beyond "current behavior" and "kill my network please"
implementations, but having a clean internal API keeps our options
open.
> Or, to not have such a big change, simply define an alternate storage
> container; in fsvs speak the "Working copy Administrative Area" (WAA), and
> use the MD5 of the files as an index there.
> That would additionally allow to share the text-bases across multiple
> check-outs, which is a nice benefit.
> If the directories are set apart, a grep won't look there.
See above. If the internal API is done right, this would definitely be
a possibility.
> (I don't want to sound like 'look what fsvs does better' -- fsvs is not
> thought for source control -- but I believe that it's got a few things right.
> [If it didn't, I'd change it to :-])
I'm sure it did! However, I think that getting rid of text-bases
alltogether is a bit steep of a change. For most projects, I like my
text-bases. The extra meg or so of disk space doesn't bother me, and
it gets me wicked fast local operations. That all starts falling down
when you start getting the gcc trunk, or checking out big hunks of
KDE/Gnome, or when using svn to store media files, as ID software did
iirc. For those cases, being able to toss text-bases, or have another
elegant way of handling them, would be great.
- Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by "Ph. Marek" <ph...@bmlv.gv.at>.
On Wednesday 17 January 2007 08:36, David Anderson wrote:
> I've been kicking the thought around for a while now, so I'll get it
> out here in the open.
>
> I think we all know about the "organic" growth of libsvn_wc.
...
> The ones I can think of right now:
>
> - Having to crawl the entire tree on most operations ...
> - Storing metadata all over the place. ...
> - Text-base storage. ...
> - Doesn't play well with ... `grep -v .svn` to filter out ...
> So, I want to break libsvn_wc.
...
> I think that libsvn_wc_sqlite addresses the issues I pointed out at
> the beginning of this mail: tree crawls are minimized,
If you can get the indizes in a sequential chunk, it may be worth it.
Else you'll get the harddisk seeking around, too (although better, I admit).
> inode count goes way down,
That's for sure.
> commandline tools don't find text-base dupes all over
> the place,
As long as you store them in a BLOB or similar, why not? grep happily looks
into binary files, just to give you the filename.
And if you use "grep --exclude *.svn*" it doesn't matter if there's one file
or 1000.
> and we have a clear internal API where we can handle the
> text-base storage problem cleanly. And, hopefully, most operations are
> reduced to an SQL select statement, which can be blindingly fast if
> the database is indexed properly.
"If the database is indexed properly". So it will have some
storage-space-cost.
I don't want to be seen as outright against that idea - it surely has it's
merits. I just don't know whether it makes sense to store multi-GB in a
database, when there's a filesystem available. It feels a bit like
file-in-database-on-nfs-mount-on-loopback-mounted-file-on-samba-share, if you
get what I mean ;-)
I think that, when such a big thing is being done, it may be good to break a
bit more -- don't store local text bases.
That saves us 50% of storage space and grep is happy.
Use partial-MD5-hashes to check for modifications (like fsvs does), and if
there's a ra call "ra_get_file_ranges" fsvs would be happy, too :-)
Or, to not have such a big change, simply define an alternate storage
container; in fsvs speak the "Working copy Administrative Area" (WAA), and
use the MD5 of the files as an index there.
That would additionally allow to share the text-bases across multiple
check-outs, which is a nice benefit.
If the directories are set apart, a grep won't look there.
(I don't want to sound like 'look what fsvs does better' -- fsvs is not
thought for source control -- but I believe that it's got a few things right.
[If it didn't, I'd change it to :-])
Regards,
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Sander Striker <st...@apache.org>.
Ben Collins-Sussman wrote:
> It sounds to me like svn 2.0, at a minimum, will have
>
> - a totally redesignd libsvn_wc
> - a redesigned FSFS implementation, based on mercurial's revlog format
I'm still wondering whether or not it doesn't make sense to make
the two the same. Effectively making your wc metadata == a (partial)
repository.
Unfortunately I won't be able to dedicate any time to this effort.
> At least, this is my impression of ideas that have real momentum
> behind them so far. :-)
Sander
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Ben Collins-Sussman <su...@red-bean.com>.
It sounds to me like svn 2.0, at a minimum, will have
- a totally redesignd libsvn_wc
- a redesigned FSFS implementation, based on mercurial's revlog format
At least, this is my impression of ideas that have real momentum
behind them so far. :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Glasser <gl...@mit.edu>.
On 1/17/07, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> So, Karl's
> earlier suggestion of storing WC data in ~/.subversion or similar is a
> non-starter for me (AIUI, this is how SVK treats checkouts).
SVK allows both "WC data in $SVKROOT, defaulting to ~/.svk" and "WC
data in a .svk in the root of a checkout".
--dave
--
David Glasser | glasser@mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Danny van Heumen <da...@hccnet.nl>.
First things first: I'm just a user with an interest in SVN
developments... so don't kill me if I'm wrong :P
Justin Erenkrantz wrote:
> I do wonder how this would impact TSVN or other GUI apps - how do they
> know if a directory is under version control? Does it even trigger if
> there isn't a .svn dir? Or, does it call some SVN APIs on every
> window change? I'm sure we could work with them to make sure that we
> don't screw them. I'd imagine for deep WCs, a GUI like TSVN might
> constantly be walking up the directory path to see if a .svn directory
> exists. I also don't know how well we'd handle excluded directories -
> i.e. user doesn't check in a certain sub-directory - it'd be nice to
> handle those efficiently as well without the time/walk penalties too.
> (Think of SVN's svn-test-work dirs.) Doable, but would need some
> thought, I think.
This was also what I was thinking about.
* On one hand, TSVN has always had to do some degree of crawling,
because it would also show the status of folders and mark them modified
if a file inside that folder had this status. (Or conflicted if a file
in that folder was conflicted.)
So, instead of crawling forward, it would be crawling backward, up the
tree. (Ofcouse this is much slower on network filesystems.)
*Worst case scenario* would be if you're on a slow filesystem, very deep
in a directory tree, and this tree isn't a working copy. It would have
to crawl all the way to the surface.
* On the other hand, TSVN could speed up once it knows about a SVN
working copy. Because it only has to look at one place for all working
copy information, and once it knows it's root folder there's no need for
crawling anymore (at least for certain operations).
In a worst case scenario I'd imagine TSVN should be triggered by
browsing through the root of the working copy, which would trigger TSVN
to discover a working copy, and so all subdirectories are automatically
part of the working copy.
Just 2 cents of my view ;)
Danny
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 1/17/07, Malcolm Rowe <ma...@farside.org.uk> wrote:
> but that's probably a question for the SQLite people. (And I've always
> thought that sharing working copies was a pretty odd thing to do; remote
> working copies, fine, but shared ones? Weird. I'd have no problem
> telling people that that's just not a supported arrangement).
Here's a use case at Apache that we rely on shared working copies: our
production websites are checked out to a group-writable directory, and
when people want to push the content live, they run 'svn up'. Anyone
in the group can run it at any time. Serving directly from SVN for
such a high-traffic site would be an issue; plus we have many vhosts -
which mod_dav_svn wouldn't play too well with. I'm sure we're not the
only people in the world doing that. (In Apache, we've always talked
about adding some automation to this to not need to do a 'svn up' and
hence have a shared WC, but we've never gotten around to it and
unlikely that we ever will.)
I chatted with Dave last night on IRC about some of these ideas, and
I'm generally +1 on his rough ideas. I don't see any problems with an
optional WC library for now - when we're ready to switch the default,
we can decide what to do then... My inviolate criteria are: multiple
users can share a WC, and the entire WC can be portable. So, Karl's
earlier suggestion of storing WC data in ~/.subversion or similar is a
non-starter for me (AIUI, this is how SVK treats checkouts).
I do wonder how this would impact TSVN or other GUI apps - how do they
know if a directory is under version control? Does it even trigger if
there isn't a .svn dir? Or, does it call some SVN APIs on every
window change? I'm sure we could work with them to make sure that we
don't screw them. I'd imagine for deep WCs, a GUI like TSVN might
constantly be walking up the directory path to see if a .svn directory
exists. I also don't know how well we'd handle excluded directories -
i.e. user doesn't check in a certain sub-directory - it'd be nice to
handle those efficiently as well without the time/walk penalties too.
(Think of SVN's svn-test-work dirs.) Doable, but would need some
thought, I think.
If we switch to an explicit severability model, I guess this means 2.0
to be on the safe side as to user expectations. I don't want to have
to explain that we silently took away something that users might have
been relying upon (largely because we're not creative enough to know
what they're doing with it) - perhaps a poll on users@ would be a good
thing? Explain it in a brief email and see if anyone is using this?
It'd be a slightly wider audience than dev@. -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Wed, Jan 17, 2007 at 03:32:33PM +0300, Ivan Zhakov wrote:
> AFAIR sqllite doesn't support NFS, because none of NFS supports
> *right* locking. Does it?
>
NFSv3 supports locking, v2 doesn't (though specific implementations may
vary: for most modern clients, the answer seems to be that "POSIX fcntl()
locks work, BSD flock() locks don't").
We already depend upon file locking in the FSFS implementation (for
transaction and commit serialisation). Interestingly, I notice that
libsvn_wc seems to assume that it can do file locking by creating a file
with O_CREAT|O_EXCL. That's unfortunate, since that doesn't work as a
locking mechanism on NFS.
So libsvn_wc is already 'broken' on NFS shared working copies. I'm not
sure to what extent introducing SQLite would make that more broken,
but that's probably a question for the SQLite people. (And I've always
thought that sharing working copies was a pretty odd thing to do; remote
working copies, fine, but shared ones? Weird. I'd have no problem
telling people that that's just not a supported arrangement).
What NFS normally does have problems with is write-ordering,
(client-server) cache coherency, the aforementioned O_EXCL 'problem'
and a generally inability to mmap() files. I'm not too sure of all the
details, though.
Regards,
Malcolm
Re: Another working copy library
Posted by Ivan Zhakov <ch...@gmail.com>.
On 1/17/07, David Anderson <da...@natulte.net> wrote:
> On 1/17/07, Ivan Zhakov <ch...@gmail.com> wrote:
>
> > > This behavior is off by default however. The default is to crawl the
> > > subtree rooted at cwd to work out what was edited, and to sanity check
> > > metadata as you go. An option passed to svn checkout makes all WC
> > > files read-only, and relies solely on the metadata to operate on the
> > > wc, unless a particular operation forces a crawl.
> > Hmm. Why you need this feature? IMHO crawling tree data spends most
> > time in reading entries and creating locks, not in reading file
> > timestamps.
> > I think that most users like ability to any edit without any commands.
>
> My main motivation for this is seeing NFS perform in an enterprise
> setting. Its performance is not stellar (far, far from it), and
> crawling the working copy requires a lot of readdir and stat calls,
> all of which go out to the network as RPC calls. I would like to have
> some mechanism to avoid those, if the user chooses to.
AFAIR sqllite doesn't support NFS, because none of NFS supports
*right* locking. Does it?
>
> However, for users who don't want to adopt this, the default checkout
> behavior would be to crawl. You do lose some of what you gained by
> using a central store, but you still get the speed improvements that
> come from not spreading the metadata all over the wc.
It's ok, if it will be not default behavior. But I'm just don't see
many reasons to spend time on this option. Just my opinion.
>
> > > Text-bases now. By default, they are stored in the metadata sqlite
> > > database (or maybe in a separate text-base sqlite DB alongside the
> > > regular metadata. Details.). I would however like to have a clear line
> > > drawn in the internals of libsvn_wc_sqlite, where we could add other
> > > behaviors in the future. Say, no text-bases and fail all operations
> > > that require them for ultra lightweight working copies, or no
> > > text-bases but retrieved via the ra api when needed (which opens the
> > > way for webdav caching proxies to work their magic).
> > Btw, Are you sure that sqllite is ready to store very big data inside?
> > Like 100 mb field?
>
> The SQLite faq recommends switching to another storage system at the
> 100GB mark. I think a 100GB working copy has other problems to attend
> to before looking at making sqlite groan :-).
Ok, I didn't know SQLite limits.
>
> According to DannyB, the biggest problem of SQLite is concurrent
> access, which is gracefully handled in our case, as touching a working
> copy takes exclusive locks anyway. However, there will be a wc
> somewhere whose text-bases SQLite can't handle properly. That is why I
> want a clean cut API within libsvn_wc_sqlite where we can drop in
> alternative mechanisms to handle text-base storage, or lack of
> storage. My favorite idea is the caching webdav proxy that can blindly
> dole out the resources as fast as the wire can carry them, but there
> would surely be other plausible ways to manage the text-bases.
>
Agreed. Concurrent access is rare situation, but it can occur when
some plugins like for Windows Explorer and Visual Studio updates
status in background. Anyway I think two application can be count as
not concurrent access.
--
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by David Anderson <da...@natulte.net>.
On 1/17/07, Ivan Zhakov <ch...@gmail.com> wrote:
> > I've been thinking about an alternative to libsvn_wc. The semantics of
> > this alternative library would be slightly different, enough that it
> > would not be perfectly compatible with the existing libsvn_wc. This is
> > why I propose this as an alternative library that follows as much as
> > possible of the current svn_wc.h API, that would be selected/enabled
> > at runtime, using a dynlib mechanism similar to the one we have for ra
> > and fs backends. From here on, I'll refer to this alternative
> > implementation as libsvn_wc_sqlite.
> Yes, yes, yes! I had the same ideas some time ago. Count me as
> volunteer on this feature.
Thanks!
> > I have never really used WC severability, but I understand there are
> > use cases, and more importantly, users of this feature. This would be
> > a first API exclusive to libsvn_wc_sqlite, something like
> > svn_wc_sever(), which takes a subtree of a WC and makes into its own,
> > standalone WC by creating a .svn/wc.db there and entering the relevant
> > metadata from the parent database. I haven't worked out the exact
> > behavior yet from the user's POV, but it would therefore mean
> > something along the lines of `svn sever wc_subdir; mv wc_subdir
> > somewhere_else`, instead of the current `mv wc_subdir somewhere_else`.
> I don't think that this feature is so required for users. At least for
> the first time.
Maybe, but we have a large user base, some of which have likely come
to rely on severability, either in their workflow or in their plain
old habits. I would like to offer some mechanism to not break things
too much for them.
> > This behavior is off by default however. The default is to crawl the
> > subtree rooted at cwd to work out what was edited, and to sanity check
> > metadata as you go. An option passed to svn checkout makes all WC
> > files read-only, and relies solely on the metadata to operate on the
> > wc, unless a particular operation forces a crawl.
> Hmm. Why you need this feature? IMHO crawling tree data spends most
> time in reading entries and creating locks, not in reading file
> timestamps.
> I think that most users like ability to any edit without any commands.
My main motivation for this is seeing NFS perform in an enterprise
setting. Its performance is not stellar (far, far from it), and
crawling the working copy requires a lot of readdir and stat calls,
all of which go out to the network as RPC calls. I would like to have
some mechanism to avoid those, if the user chooses to.
However, for users who don't want to adopt this, the default checkout
behavior would be to crawl. You do lose some of what you gained by
using a central store, but you still get the speed improvements that
come from not spreading the metadata all over the wc.
> > Text-bases now. By default, they are stored in the metadata sqlite
> > database (or maybe in a separate text-base sqlite DB alongside the
> > regular metadata. Details.). I would however like to have a clear line
> > drawn in the internals of libsvn_wc_sqlite, where we could add other
> > behaviors in the future. Say, no text-bases and fail all operations
> > that require them for ultra lightweight working copies, or no
> > text-bases but retrieved via the ra api when needed (which opens the
> > way for webdav caching proxies to work their magic).
> Btw, Are you sure that sqllite is ready to store very big data inside?
> Like 100 mb field?
The SQLite faq recommends switching to another storage system at the
100GB mark. I think a 100GB working copy has other problems to attend
to before looking at making sqlite groan :-).
According to DannyB, the biggest problem of SQLite is concurrent
access, which is gracefully handled in our case, as touching a working
copy takes exclusive locks anyway. However, there will be a wc
somewhere whose text-bases SQLite can't handle properly. That is why I
want a clean cut API within libsvn_wc_sqlite where we can drop in
alternative mechanisms to handle text-base storage, or lack of
storage. My favorite idea is the caching webdav proxy that can blindly
dole out the resources as fast as the wire can carry them, but there
would surely be other plausible ways to manage the text-bases.
- Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Another working copy library
Posted by Ivan Zhakov <ch...@gmail.com>.
On 1/17/07, David Anderson <da...@natulte.net> wrote:
> I've been kicking the thought around for a while now, so I'll get it
> out here in the open.
>
> I think we all know about the "organic" growth of libsvn_wc. As more
> large projects like gcc or KDE adopt Subversion, they are starting to
> also run into scalability issues with the working copy library that
> cannot be resolved easily (not to mention companies that have groaned
> a little about this).
>
> The ones I can think of right now:
>
> - Having to crawl the entire tree on most operations to compute local
> changes. While not too bad for a vast majority of users, large trees
> take a long time to crawl, and don't even get me started on large tree
> + nfs.
>
> - Storing metadata all over the place. This is by design, to allow
> for working copy severability. It's a nice feature, but it's many more
> inodes than is reasonable on large trees. And it's another component
> of having to recrawl a huge tree for most operations.
>
> - Text-base storage. Being able to forego these, or even fetch them
> on-demand, has been a feature request for a long, long time. It
> doesn't look to me like we'll be implementing this any time soon,
> because of the state of libsvn_wc.
>
> - Doesn't play well with other commandline tools. When I do find or
> grep runs over a working copy, I always have to pipe that through
> `grep -v .svn` to filter out all the dupes. The tool still has to
> crawl twice the number of inodes and output twice the actual amount of
> data. And yes, I'm sure there is a nifty hidden switch in both find
> and grep that would let me exclude this intelligently. I'm sure I can
> find another tree-crawling tool that we equally break and that doesn't
> have an exclusion capability.
>
> So, basically, I think that our working copy design has worked okay
> for most people, but it's now shown its limits, and it might be time
> for a change.
>
> So, I want to break libsvn_wc.
>
> Okay, now, calm down, and read through before killing me.
>
> I've been thinking about an alternative to libsvn_wc. The semantics of
> this alternative library would be slightly different, enough that it
> would not be perfectly compatible with the existing libsvn_wc. This is
> why I propose this as an alternative library that follows as much as
> possible of the current svn_wc.h API, that would be selected/enabled
> at runtime, using a dynlib mechanism similar to the one we have for ra
> and fs backends. From here on, I'll refer to this alternative
> implementation as libsvn_wc_sqlite.
Yes, yes, yes! I had the same ideas some time ago. Count me as
volunteer on this feature.
>
>
> libsvn_wc_sqlite stores all the metadata for a working copy in a
> *single* SQLite database. This sqlite database is located in a .svn
> subdirectory inside the root of the working copy. So, for example, if
> you were to check out the svn trunk from svn.collab.net, you would
> have trunk/.svn containing wc.db (and probably some other very
> lightweight stuff, like a wc version file). There is no other .svn
> directory anywhere else in the working copy. When you invoke an svn
> command that needs to look at the working copy, libsvn_wc_sqlite walks
> back up the tree from the cwd until it finds a .svn directory, and
> uses that metadata for the entire tree rooted at that directory.
>
> This preserves working copy portability, and breaks working copy
> severability. That is, you can still move an entire checkout ('trunk'
> in my previous example) somewhere else and have a working WC, but you
> can't move a subtree out (say 'trunk/subversion') and have that be a
> functionning working copy for that subtree. In fact, doing the latter
> would have the effect of exporting that subtree: no metadata, just the
> files.
>
> I have never really used WC severability, but I understand there are
> use cases, and more importantly, users of this feature. This would be
> a first API exclusive to libsvn_wc_sqlite, something like
> svn_wc_sever(), which takes a subtree of a WC and makes into its own,
> standalone WC by creating a .svn/wc.db there and entering the relevant
> metadata from the parent database. I haven't worked out the exact
> behavior yet from the user's POV, but it would therefore mean
> something along the lines of `svn sever wc_subdir; mv wc_subdir
> somewhere_else`, instead of the current `mv wc_subdir somewhere_else`.
I don't think that this feature is so required for users. At least for
the first time.
>
>
> Another thing I'd very much like is to completely eliminate all
> implicit tree crawls. The metadata is the working copy, unless the
> user requests a forced crawl to update metadata for some reason.
>
> This implies telling Subversion about all operations on versionned
> data. We already do that for all operations, except for edits. I'd
> like to change that. libsvn_wc_sqlite checks out the working copy
> entirely read-only, and you have to tell svn (through something like
> `svn edit file`... Yes, I have been using perforce lately) that you
> are touching it, at which point it'll record that in the metadata and
> flip the file to be writable.
>
> This behavior is off by default however. The default is to crawl the
> subtree rooted at cwd to work out what was edited, and to sanity check
> metadata as you go. An option passed to svn checkout makes all WC
> files read-only, and relies solely on the metadata to operate on the
> wc, unless a particular operation forces a crawl.
Hmm. Why you need this feature? IMHO crawling tree data spends most
time in reading entries and creating locks, not in reading file
timestamps.
I think that most users like ability to any edit without any commands.
>
>
> Text-bases now. By default, they are stored in the metadata sqlite
> database (or maybe in a separate text-base sqlite DB alongside the
> regular metadata. Details.). I would however like to have a clear line
> drawn in the internals of libsvn_wc_sqlite, where we could add other
> behaviors in the future. Say, no text-bases and fail all operations
> that require them for ultra lightweight working copies, or no
> text-bases but retrieved via the ra api when needed (which opens the
> way for webdav caching proxies to work their magic).
Btw, Are you sure that sqllite is ready to store very big data inside?
Like 100 mb field?
>
>
> I think that libsvn_wc_sqlite addresses the issues I pointed out at
> the beginning of this mail: tree crawls are minimized, inode count
> goes way down, commandline tools don't find text-base dupes all over
> the place, and we have a clear internal API where we can handle the
> text-base storage problem cleanly. And, hopefully, most operations are
> reduced to an SQL select statement, which can be blindingly fast if
> the database is indexed properly.
>
> I'm not claiming that it is perfect, it is a different tradeoff on
> various points. I do think, however, that it is worth it.
>
>
> You're now all invited to shoot this idea down with sensible
> arguments. I will now go and make peace with myself while you assemble
> the firing squad :-). Oh, and I am willing to attempt to put
> changesets where my mouth is, this isn't a rant calling for someone
> else to do it.
>
--
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org