You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2004/03/31 05:57:22 UTC

FS abstraction levels

I have developed a twelve-step plan for implementing the FS-backed FS,
but I think I should slow down and worry about the abstraction issues
first.  So:

In another thread, Branko asked:
> Can someone refresh my memory as to why we'd need two abstraction
> layers? I've been out of town for a while...

CMike wrote (not in direct reply):
> There has been some dispute over the necessity of [abstracting at
> the libsvn_fs level].  I understand Glenn's defense of that
> position, but think we need a few more knowledgable heads in the
> circle before making that call.

I'd like to generate consensus that:

  * It's necessary to abstract at the libsvn_fs API level for my
    project.

  * It's desirable to abstract the current BDB implementation at the
    storage level for future projects.  (Perhaps this should wait
    until someone is actively interested in instantiating a second
    database-backed FS implementation, but I have no objections if it
    doesn't wait.)

  * These two abstractions are orthogonal, and the storage abstraction
    has no bearing on my project.

  * Documenting the FS schema as Branko suggests has bearing on the
    second abstraction, but not so much on the first.  (Which is not
    to suggest that I want to depart from the general FS concepts,
    like nodes and node-copies and node-revs, but I think we already
    have those adequately documented in libsvn_fs/structure, mixed in
    with their representation.  It's possible that I'm unclear on the
    meaning of "schema" as he's using it.)

My reasoning is that the storage abstraction assumes an underlying
representation which can (a) efficiently support many small
associations, and (b) support transactions.  If you have underlying
representation with these qualities, then there is no point in
duplicating the code which maps FS concepts onto DB associations, but
if you don't have those qualities, you'll want a representation with
mostly or totally different algorithms.

Earlier, CMike wrote:
> I'll gladly wrangle libsvn_fs into the necessary state to allow for
> pluggable backends.

Does this extend to working on the top-level abstraction, assuming we
do that, or should I treat that as a separate change?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.
Hey

>Word documents are a total non-starter.  Please present your design
>contributions as text documents, preferrably posted to the list rather
>than linked.  (So that if someone comes back to this conversation in the
>list archive, they find actual content rather than a stale link.)
>

As a first attempt to get to what Greg proposes.
http://www.cdrguys.com/subversion/index.html
Has three new files in green.
A PDF.
A HTML that is moving in the right direction.
And a tarball of the HTML.
I'll do some more clean up.  But if I post it as an attachment, I'm sure 
I'll get flamed.  It has images in it!

I'll be away until late tomorrow. So I figured that I should post so 
that people knew that I am working the formatting issue:-)

gat




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.
I'll change the format.

Greg Hudson wrote:

>On Wed, 2004-03-31 at 08:20, Glenn A. Thompson wrote:
>  
>
>>Before you guys go any further on these.  I'd like to beg folks to read:
>>http://www.cdrguys.com/subversion/Pluggable3.doc
>>    
>>
>
>Word documents are a total non-starter.  Please present your design
>contributions as text documents, preferrably posted to the list rather
>than linked.  (So that if someone comes back to this conversation in the
>list archive, they find actual content rather than a stale link.)
>
>
>  
>

Re: FS abstraction levels

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2004-03-31 at 08:20, Glenn A. Thompson wrote:
> Before you guys go any further on these.  I'd like to beg folks to read:
> http://www.cdrguys.com/subversion/Pluggable3.doc

Word documents are a total non-starter.  Please present your design
contributions as text documents, preferrably posted to the list rather
than linked.  (So that if someone comes back to this conversation in the
list archive, they find actual content rather than a stale link.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.
Hey,

>I'd like to generate consensus that:
>
>  * It's necessary to abstract at the libsvn_fs API level for my
>    project.
>
Totally!

>
>  * It's desirable to abstract the current BDB implementation at the
>    storage level for future projects.  (Perhaps this should wait
>    until someone is actively interested in instantiating a second
>    database-backed FS implementation, but I have no objections if it
>    doesn't wait.)
>
I'd like to see (at least) the design work done at the same time.  
Mainly because it will force us to think about more issues up front.

>
>  * These two abstractions are orthogonal, and the storage abstraction
>    has no bearing on my project.
>
Yup!

>
>  * Documenting the FS schema as Branko suggests has bearing on the
>    second abstraction, but not so much on the first.  (Which is not
>    to suggest that I want to depart from the general FS concepts,
>    like nodes and node-copies and node-revs, but I think we already
>    have those adequately documented in libsvn_fs/structure, mixed in
>    with their representation.  It's possible that I'm unclear on the
>    meaning of "schema" as he's using it.)
>
I haven't read the structure docs in a while.  The last time I did, it 
was a little out of date.  I assume they were updated in the last year? :-)

Before you guys go any further on these.  I'd like to beg folks to read:
http://www.cdrguys.com/subversion/Pluggable3.doc
While my writing may be less than stellar, I give a fair amount of 
thought to the abstraction.
I also want to point out that a logging system is long overdue.  My 
pointer marshaling wasn't *that* bad as a temp fix to the BDB short comings.

gat



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Ben Reser <be...@reser.org>.
On Fri, Apr 02, 2004 at 03:08:03PM -0800, Greg Stein wrote:
> Well, I think it would be much better to have a cover/shim library that a
> SQL backend could use, rather than writing a gazillion db-specific FS
> modules.

That's fine with me if there's one that works well.  I can't really
answer this question becuase I haven't really tried to 

> But if you were going with a pure Oracle approach, then the best API is
> the 'upi' library. Does Oracle publish that at all? That was what we used
> internally when I worked at Oracle, but I dunno that they ever let
> customers at the thing. Anybody know?

UPI is even lower level than OCI:
http://www.devx.com/dbzone/Article/19969/0/page/2

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Apr 02, 2004 at 10:50:15PM +0200, Marcin Kasperski wrote:
>...
> In my too. Of course the first thing to do while programming with 
> OCI is to write some normally looking library over it or choose 
> one existing.
> 
> AFAIK there are at least two open-source libraries covering OCI 
> with more natural API (Ora++ and OTL). In my organization we 
> have written our own library so I can't comment on them but this 
> could be a way to go.

Well, I think it would be much better to have a cover/shim library that a
SQL backend could use, rather than writing a gazillion db-specific FS
modules.

But if you were going with a pure Oracle approach, then the best API is
the 'upi' library. Does Oracle publish that at all? That was what we used
internally when I worked at Oracle, but I dunno that they ever let
customers at the thing. Anybody know?

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: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.
Hey,

Marcin Kasperski wrote:

>>>>Absolutely. I'm already interested in an Oracle back-end (or
>>>>rather, if I had one now, I could "sell" Subverison to a
>>>>very, very, rich company...)
>>>>        
>>>>
>>>FYI as an OCI hacker I wouldn't mind helping out on this. 
>>>I'm probably one of the few brave souls who's actually
>>>written code directly to OCI not the Pro*C/C++ preprocessor.
>>>      
>>>
>>There you go!  OCI is the only way to go in my opinion.
>>    
>>
>
>In my too. Of course the first thing to do while programming with 
>OCI is to write some normally looking library over it or choose 
>one existing.
>
>AFAIK there are at least two open-source libraries covering OCI 
>with more natural API (Ora++ and OTL). In my organization we 
>have written our own library so I can't comment on them but this 
>could be a way to go.
>  
>
Yup!  I started one.  It was working in cheesy test cases on linux 
sitting over ODBC->Mysql.  I also started a native Mysql and I think a 
OCI adapter (s) for it.  The main reason I started writing my own was 
that at the time I didn't find anything for C.  Plus, my stuff uses APR 
for everything it could.  It does do some things differently than 
traditional JDBC ODBC.  For instance, it supports loading SQL statements 
from Subversion config files.  It  supports identification of parameters 
and parameter types in those files as well.  Actually, quite a bit more 
now that I think of it.  Of course, that code hasn't been run in about 
18 months:-)  But I can get it going when the plugin stuff is in place.

>Pro*C/C++ is terrible. Avoid it.
>
I don't know if I'd call it terrible.  It's just tooooo proprietary.
gat


Re: FS abstraction levels

Posted by Marcin Kasperski <Ma...@softax.com.pl>.
> >>Absolutely. I'm already interested in an Oracle back-end (or
> >> rather, if I had one now, I could "sell" Subverison to a
> >> very, very, rich company...)
> >
> >FYI as an OCI hacker I wouldn't mind helping out on this. 
> > I'm probably one of the few brave souls who's actually
> > written code directly to OCI not the Pro*C/C++ preprocessor.
>
> There you go!  OCI is the only way to go in my opinion.

In my too. Of course the first thing to do while programming with 
OCI is to write some normally looking library over it or choose 
one existing.

AFAIK there are at least two open-source libraries covering OCI 
with more natural API (Ora++ and OTL). In my organization we 
have written our own library so I can't comment on them but this 
could be a way to go.

Pro*C/C++ is terrible. Avoid it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.

Ben Reser wrote:

>On Wed, Mar 31, 2004 at 01:07:41PM +0200, Branko Cibej wrote:
>  
>
>>Absolutely. I'm already interested in an Oracle back-end (or rather, if I had
>>one now, I could "sell" Subverison to a very, very, rich company...)
>>    
>>
>
>FYI as an OCI hacker I wouldn't mind helping out on this.  I'm probably
>one of the few brave souls who's actually written code directly to OCI
>not the Pro*C/C++ preprocessor.
>
There you go!  OCI is the only way to go in my opinion.

gat


Re: FS abstraction levels

Posted by Ben Reser <be...@reser.org>.
On Wed, Mar 31, 2004 at 01:07:41PM +0200, Branko Cibej wrote:
> Absolutely. I'm already interested in an Oracle back-end (or rather, if I had
> one now, I could "sell" Subverison to a very, very, rich company...)

FYI as an OCI hacker I wouldn't mind helping out on this.  I'm probably
one of the few brave souls who's actually written code directly to OCI
not the Pro*C/C++ preprocessor.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Branko Cibej <br...@xbc.nu>.
Quoting Greg Hudson <gh...@MIT.EDU>:

> I have developed a twelve-step plan for implementing the FS-backed FS,
> but I think I should slow down and worry about the abstraction issues
> first.  So:
> 
> In another thread, Branko asked:
> > Can someone refresh my memory as to why we'd need two abstraction
> > layers? I've been out of town for a while...
> 
> CMike wrote (not in direct reply):
> > There has been some dispute over the necessity of [abstracting at
> > the libsvn_fs level].  I understand Glenn's defense of that
> > position, but think we need a few more knowledgable heads in the
> > circle before making that call.
> 
> I'd like to generate consensus that:
> 
>   * It's necessary to abstract at the libsvn_fs API level for my
>     project.

Hm, you're right, the FS back-end would be better split at the API level,
wouldn't it.

>   * It's desirable to abstract the current BDB implementation at the
>     storage level for future projects.  (Perhaps this should wait
>     until someone is actively interested in instantiating a second
>     database-backed FS implementation, but I have no objections if it
>     doesn't wait.)

Absolutely. I'm already interested in an Oracle back-end (or rather, if I had
one now, I could "sell" Subverison to a very, very, rich company...)

>   * These two abstractions are orthogonal, and the storage abstraction
>     has no bearing on my project.

Yes.

>   * Documenting the FS schema as Branko suggests has bearing on the
>     second abstraction, but not so much on the first.  (Which is not
>     to suggest that I want to depart from the general FS concepts,
>     like nodes and node-copies and node-revs, but I think we already
>     have those adequately documented in libsvn_fs/structure, mixed in
>     with their representation.  It's possible that I'm unclear on the
>     meaning of "schema" as he's using it.)

Ah, yes. Well, I'm thinking both ways: a DB shcema for database back-ends, and
an architecture (nodes, revs, etc.) that API-level providers have to follow so
that their semantics are compatible with the rest of Subversion.

I'm almost completely convinced now that we'll have to expose the concept of
nodes even more publicly in the future, if we want to get more efficient working
copies and replicated or distributed operation. But that's in 2.0 land.

> My reasoning is that the storage abstraction assumes an underlying
> representation which can (a) efficiently support many small
> associations, and (b) support transactions.  If you have underlying
> representation with these qualities, then there is no point in
> duplicating the code which maps FS concepts onto DB associations, but
> if you don't have those qualities, you'll want a representation with
> mostly or totally different algorithms.

Yup, your reasoning is sound -- as always. :-)


-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "Glenn A. Thompson" <gt...@cdr.net>.
Hey,

>I was a bit schisophrenic, wasn't I? Stream-of-consciousness thingy. :-)
>
>What I meant was that it would be nice if all FS implementations could reuse the
>DAG logic, and that the easiest way to do that might be to move the vtable below
>the dag.c level rather than below the tree.c level.
>  
>
I don't think it would be nice at all:-)  I see the current tree and dag 
code evolving into what I call a File System Abstract Provider and the 
current BDB FS would be a concrete implementation of it.  If I 
understood Greg's FS_FS posts, he isn't confident that he will get much 
code reuse out of the current tree and dag code.

>> cmike
>>I can't say if this is true to not; I *can* say that it's a crying
>> shame that you'll basically be reimplementing the entire libsvn_fs.
> Greg
>I don't think I can reuse much of an implementation that maps FS
>concepts to DB concepts.  Though there may be some stuff that can be
>factored out, particularly in the realm of auto-merging.

I don't think "how much code reuse we can get" is a good metric to apply to this process.  I'm not saying that the existing code needs to be re-written.  Over time I see three (potentially four) Abstract Provider frameworks.  Each could have more than one concrete implementation. 

Hash map based
FS based
SQL based
and maybe something based on pure XML standards.  However, my head spins every time I look at XML *standards* with respect to querying.  This this is a big ol' dunno for me.

gat

PS I exported my Word doc to HTML and ran it through a cleaner. It's a little hosed right now.  So, I'll edit it a little and post it either today or tomorrow.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Branko Cibej <br...@xbc.nu>.
Quoting Greg Hudson <gh...@MIT.EDU>:

> On Wed, 2004-03-31 at 21:19, Branko Čibej wrote:
> > >I don't think I can reuse much of an implementation that maps FS
> > >concepts to DB concepts.  Though there may be some stuff that can
> be
> > >factored out, particularly in the realm of auto-merging.
> 
> > And probably the DAG abstraction, too. Maybe the API vtable should be
> at
> > the DAG layer, not the public FS layer.
> 
> Does this count as a drive-by proposal?
> 
> For one thing, I can't tell what you mean.  Sentence one suggests I
> could reuse the code in dag.c (which I doubt), and sentence two suggests
> we should put the abstraction barrier at a level which allows multiple
> different implementations of dag.c (which I also doubt; tree.c appears
> to rely on the concept of transactions).

I was a bit schisophrenic, wasn't I? Stream-of-consciousness thingy. :-)

What I meant was that it would be nice if all FS implementations could reuse the
DAG logic, and that the easiest way to do that might be to move the vtable below
the dag.c level rather than below the tree.c level.

No, I haven't the faintest idea how hard (easy?) that would be.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2004-03-31 at 21:19, Branko Čibej wrote:
> >I don't think I can reuse much of an implementation that maps FS
> >concepts to DB concepts.  Though there may be some stuff that can be
> >factored out, particularly in the realm of auto-merging.

> And probably the DAG abstraction, too. Maybe the API vtable should be at
> the DAG layer, not the public FS layer.

Does this count as a drive-by proposal?

For one thing, I can't tell what you mean.  Sentence one suggests I
could reuse the code in dag.c (which I doubt), and sentence two suggests
we should put the abstraction barrier at a level which allows multiple
different implementations of dag.c (which I also doubt; tree.c appears
to rely on the concept of transactions).


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: FS abstraction levels

Posted by Branko Čibej <br...@xbc.nu>.
Greg Hudson wrote:

>On Wed, 2004-03-31 at 08:56, C. Michael Pilato wrote:
>  
>
>>>  * It's necessary to abstract at the libsvn_fs API level for my
>>>    project.
>>>      
>>>
>>I can't say if this is true to not; I *can* say that it's a crying
>>shame that you'll basically be reimplementing the entire libsvn_fs.
>>    
>>
>
>I don't think I can reuse much of an implementation that maps FS
>concepts to DB concepts.  Though there may be some stuff that can be
>factored out, particularly in the realm of auto-merging.
>  
>
And probably the DAG abstraction, too. Maybe the API vtable should be at
the DAG layer, not the public FS layer.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2004-03-31 at 08:56, C. Michael Pilato wrote:
> >   * It's necessary to abstract at the libsvn_fs API level for my
> >     project.
> 
> I can't say if this is true to not; I *can* say that it's a crying
> shame that you'll basically be reimplementing the entire libsvn_fs.

I don't think I can reuse much of an implementation that maps FS
concepts to DB concepts.  Though there may be some stuff that can be
factored out, particularly in the realm of auto-merging.

> On a technical note, I assume we're looking at an RA-ish abstraction.
> libsvn_fs becomes a loader library for libsvn_fs_db (which in turn
> plugs into libsvn_fs_bdb and libsvn_fs_oracle and ...) and
> libsvn_fs_fs ?

Yes, that sounds right.  (That's perhaps more like svn_stream than like
svn_ra from the caller's point of view.)

There may also be a place for utility functions shared by all the FS
implementations, which don't belong in libsvn_subr.  Those could live in
libsvn_fs itself if there's no issue with circular function
dependencies.

> Absolutely.  In fact, once you have the API abstraction in place, the
> secondary abstraction becomes a feature of libsvn_fs_db, not of
> libsvn_fs.  Your fs_fs module likely won't even have such a secondary
> abstraction, right?

Right.  You can imagine that the second layer of abstraction for
libsvn_fs_fs is the operating system's filesystem abstraction
(apr_open/apr_read/apr_write).  If there were an OS interface for
transactional DB-like functionality, we wouldn't need a second layer of
abstraction in libsvn_fs_bdb.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: FS abstraction levels

Posted by "C. Michael Pilato" <cm...@collab.net>.
Greg Hudson <gh...@MIT.EDU> writes:

> I'd like to generate consensus that:
> 
>   * It's necessary to abstract at the libsvn_fs API level for my
>     project.

I can't say if this is true to not; I *can* say that it's a crying
shame that you'll basically be reimplementing the entire libsvn_fs.
But GAT and others agree that this level of abstraction is needed, and
I have no strong feelings that they are wrong.

On a technical note, I assume we're looking at an RA-ish abstraction.
libsvn_fs becomes a loader library for libsvn_fs_db (which in turn
plugs into libsvn_fs_bdb and libsvn_fs_oracle and ...) and
libsvn_fs_fs ?

>   * It's desirable to abstract the current BDB implementation at the
>     storage level for future projects.  (Perhaps this should wait
>     until someone is actively interested in instantiating a second
>     database-backed FS implementation, but I have no objections if it
>     doesn't wait.)

+1.  And if you don't need this abstraction right now, then by all
means it can wait until it *is* needed.

>   * These two abstractions are orthogonal, and the storage abstraction
>     has no bearing on my project.

Absolutely.  In fact, once you have the API abstraction in place, the
secondary abstraction becomes a feature of libsvn_fs_db, not of
libsvn_fs.  Your fs_fs module likely won't even have such a secondary
abstraction, right?

>   * Documenting the FS schema as Branko suggests has bearing on the
>     second abstraction, but not so much on the first.

Absolutely.

> Earlier, CMike wrote:
> > I'll gladly wrangle libsvn_fs into the necessary state to allow for
> > pluggable backends.
> 
> Does this extend to working on the top-level abstraction, assuming we
> do that, or should I treat that as a separate change?

I think I should've said "I'll gladly help to wrangle..."  :-)
But yes, I'll make myself available to work on both tasks.  And as I
noted above, the top-level abstraction appears now to be the only one
currently in-demand.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org