You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@xbc.nu> on 2002/10/21 00:02:59 UTC

[PATCH] Support both BDB 4.0 and 4.1

Just a heads-up,

I took Justin's patch and forced it to support both BDB 4.0.x and 4.1.x. 
I also uploaded a Win32 binary of BDB 4.1.24, if anyone would like to 
test this on Windows -- although note that you'll have to change the 
.dsp files to link with libdb41.lib instead of libdb40.lib.

I think we shouldn't announce support for DBD 4.1 just yet; I'm 
attaching this patch in the hope that people will test it on Unix boxes. 
I'm testing it on Windows right now (with both BDB versions), and will 
commit once some Unix test reports come in.

Oh yes, the log message:

Added support for building with both Berkeley DB 4.0.14 and 4.1.24.
Based on this patch by Justin Erenkrantz <je...@apache.org>:

    http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=22004

[ in subversion/libsvn_fs ]
* bdb/bdb_compat.h: New header. Definitions for BDB 4.0/4.1 compatibility.

* bdb/changes-table.c, bdb/copies-table.c, bdb/nodes-table.c, bdb/reps-table.c,
  bdb/rev-table.c, bdb/strings-table.c, bdb/txn-table.c:
Include bdb_compat.h instead of db.h. In calls to DB->open, wrap the
environment and transaction parameter in SVN_BDB_OPEN_PARAMS. Pass the
SVN_BDB_AUTO_COMMIT flag to DB->open and DB->put wherever the transaction
is NULL. Check the BDB version before each call to db_create.

* bdb/changes-table.h, bdb/dbt.c, bdb/dbt.h, bdb/nodes-table.h,
  bdb/strings-table.h, bdb/rev-table.h: Include bdb_compat.h instead of db.h.

* fs.c: Include bdb/bdb_compat.h.
(check_db_version): New function.
(check_already_open): Extract version check into check_db_version.
(svn_fs_create_berkeley, svn_fs_open_berkeley): Call check_db_version.
(cleanup_fs_db, cleanup_fs): Make usage of DB_INCOMPLETE conditional.




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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by br...@xbc.nu.
Quoting Justin Erenkrantz <je...@apache.org>:

> FWIW, I can't read brane's patch because it looks like his mailer 
> wrapped the lines.

Huh? Impossible. The patch is a base64-encoded attachment.

> Perhaps it's my mailer?

Yup. :-)
If you like, I can make the patch accessible from the Web later today.

> Yet, ++1 to the concept.  -- justin

Great!

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Justin Erenkrantz <je...@apache.org>.
--On Monday, October 21, 2002 12:15 AM -0400 Jeff Stuart 
<js...@computer-city.net> wrote:

> Is BDB 4.0 db files compatible with BDB 4.1?  Is there a conversion
> utility?

From what I saw, you have to run 'svnadmin recover' on the repository 
since the shared memory segment format changed.  'db_recover -ve' 
will do the same thing.  Once you do that, it's happy.

FWIW, I can't read brane's patch because it looks like his mailer 
wrapped the lines.  Perhaps it's my mailer?

Yet, ++1 to the concept.  -- justin

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Jeff Stuart <js...@computer-city.net>.
On Sun, 2002-10-20 at 20:02, Branko Čibej wrote:
> Just a heads-up,
> 
> I took Justin's patch and forced it to support both BDB 4.0.x and 4.1.x. 
> I also uploaded a Win32 binary of BDB 4.1.24, if anyone would like to 
> test this on Windows -- although note that you'll have to change the 
> .dsp files to link with libdb41.lib instead of libdb40.lib.
> 
> I think we shouldn't announce support for DBD 4.1 just yet; I'm 
> attaching this patch in the hope that people will test it on Unix boxes. 
> I'm testing it on Windows right now (with both BDB versions), and will 
> commit once some Unix test reports come in.
> 
Is BDB 4.0 db files compatible with BDB 4.1?  Is there a conversion
utility?

-- 
Jeff Stuart <js...@computer-city.net>

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> > Aha! That's an APR bug, then. It's not passing DB_INIT_TXN to
> > DB_:ENV->open; compare with libsvn_fs/fs.c:494. In fact, APR doesn't
> > seem to be opening an environment at all, si I suspect it shouldn't
> > be using DB_AUTO_COMMIT. Well, duh.
> 
> >
> Philip, could you try this patch?
> 
> Index: apr_dbm_berkeleydb.c
> ===================================================================
> RCS file: /home/cvs/apr-util/dbm/apr_dbm_berkeleydb.c,v
> retrieving revision 1.20
> diff -u -r1.20 apr_dbm_berkeleydb.c
> --- apr_dbm_berkeleydb.c	4 Oct 2002 04:25:12 -0000	1.20
> +++ apr_dbm_berkeleydb.c	24 Oct 2002 00:00:31 -0000

That seems to do the trick.  I've run basic_tests.py and
commit_tests.py, I still see failures, but only those that also fail
with BDB 4.0 (I already reported these, it looks like an
svn_stringbuf_t versus svn_string_t problem).

-- 
Philip Martin

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

Re: [PATCH] Support both BDB 4.0 and 4.1

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

> Philip Martin wrote:
>
>> Branko ÄŒibej <br...@xbc.nu> writes:
>>
>>  
>>
>>> Here's a second version of this patch, slightly cleaned up. I moved
>>> svn_bdb__check_version into its own file, and I realised there's no
>>> need to remember the compile-time DB version in static variables --
>>> those defines are constants, anyway. I also reverted the include of
>>> bdb_compat.h from the headers that didn't use any of its features.
>>>   
>>
>>
>> The .dsp bit didn't apply, but what do I care about that gooey stuff :)
>>
>> It still doesn't work over ra_dav, I've built BDB 4.1 with debug so I
>> now know exactly where it's failing:
>>
> [snip gdb-fu]
>
>> The relevant BDB code is
>>
>>     if (!TXN_ON(dbenv)) {
>>         __db_err(dbenv,
>>    "DB_AUTO_COMMIT may not be specified in non-transactional 
>> environment");
>>         return (EINVAL);
>>     }
>>
>>
>> The AUTO_COMMIT flag is added by vt_db_open in apr_dbm_open.c.
>>
>
> Aha! That's an APR bug, then. It's not passing DB_INIT_TXN to 
> DB_:ENV->open; compare with libsvn_fs/fs.c:494. In fact, APR doesn't 
> seem to be opening an environment at all, si I suspect it shouldn't be 
> using DB_AUTO_COMMIT. Well, duh.
>
Philip, could you try this patch?

Index: apr_dbm_berkeleydb.c
===================================================================
RCS file: /home/cvs/apr-util/dbm/apr_dbm_berkeleydb.c,v
retrieving revision 1.20
diff -u -r1.20 apr_dbm_berkeleydb.c
--- apr_dbm_berkeleydb.c	4 Oct 2002 04:25:12 -0000	1.20
+++ apr_dbm_berkeleydb.c	24 Oct 2002 00:00:31 -0000
@@ -199,9 +199,6 @@
         int dberr;
 
 #if DB_VER >= 3
-#if DB_VER == 4
-        dbmode |= DB_AUTO_COMMIT;
-#endif
         if ((dberr = db_create(&file.bdb, NULL, 0)) == 0) {
             if ((dberr = (*file.bdb->open)(file.bdb,
 #if DB_VER == 4
@@ -288,11 +285,7 @@
     apr_status_t rv;
     DBT ckey = { 0 };
     DBT cvalue = { 0 };
-#if DB_VER == 4
-    int flags = DB_AUTO_COMMIT;
-#else
     int flags = 0;
-#endif
 
     ckey.data = key.dptr;
     ckey.size = key.dsize;
@@ -314,11 +307,7 @@
 {
     apr_status_t rv;
     DBT ckey = { 0 };
-#if DB_VER == 4
-    int flags = DB_AUTO_COMMIT;
-#else
     int flags = 0;
-#endif
 
     ckey.data = key.dptr;
     ckey.size = key.dsize;




-- 
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: [PATCH] Support both BDB 4.0 and 4.1

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Branko ÄŒibej <br...@xbc.nu> writes:
>
>  
>
>>Here's a second version of this patch, slightly cleaned up. I moved
>>svn_bdb__check_version into its own file, and I realised there's no
>>need to remember the compile-time DB version in static variables --
>>those defines are constants, anyway. I also reverted the include of
>>bdb_compat.h from the headers that didn't use any of its features.
>>    
>>
>
>The .dsp bit didn't apply, but what do I care about that gooey stuff :)
>
>It still doesn't work over ra_dav, I've built BDB 4.1 with debug so I
>now know exactly where it's failing:
>
[snip gdb-fu]

>The relevant BDB code is
>
>	if (!TXN_ON(dbenv)) {
>		__db_err(dbenv,
>    "DB_AUTO_COMMIT may not be specified in non-transactional environment");
>		return (EINVAL);
>	}
>
>
>The AUTO_COMMIT flag is added by vt_db_open in apr_dbm_open.c.
>

Aha! That's an APR bug, then. It's not passing DB_INIT_TXN to 
DB_:ENV->open; compare with libsvn_fs/fs.c:494. In fact, APR doesn't 
seem to be opening an environment at all, si I suspect it shouldn't be 
using DB_AUTO_COMMIT. Well, duh.

-- 
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: [PATCH] Support both BDB 4.0 and 4.1

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> Here's a second version of this patch, slightly cleaned up. I moved
> svn_bdb__check_version into its own file, and I realised there's no
> need to remember the compile-time DB version in static variables --
> those defines are constants, anyway. I also reverted the include of
> bdb_compat.h from the headers that didn't use any of its features.

The .dsp bit didn't apply, but what do I care about that gooey stuff :)

It still doesn't work over ra_dav, I've built BDB 4.1 with debug so I
now know exactly where it's failing:

(gdb) 
977                     __db_err(dbenv,
(gdb) bt
#0  __db_txn_auto (dbp=0x8129020, txnidp=0xbffff7d4)
    at ../dist/../db/db_iface.c:977
#1  0x40171c20 in __db_open (dbp=0x8129020, txn=0x0, 
    name=0x8128ff0 "/tmp/repo/dav/activities", subdb=0x0, type=DB_HASH, 
    flags=8388609, mode=511) at ../dist/../db/db_open.c:71
#2  0x40119242 in vt_db_open (pdb=0xbffff89c, 
    pathname=0x8128ff0 "/tmp/repo/dav/activities", mode=3, perm=4095, 
    pool=0x80ea928) at apr_dbm_berkeleydb.c:206
#3  0x40118df4 in apr_dbm_open (pdb=0xbffff89c, 
    pathname=0x8128ff0 "/tmp/repo/dav/activities", mode=3, perm=4095, 
    pool=0x80ea928) at apr_dbm.c:124
#4  0x403f4d59 in dav_svn_store_activity (repos=0x8126630, 
    activity_id=0x8126552 "e379665f-b3ad-0310-955b-bb9cc82369b2", 
    txn_name=0x80e5498 "3") at ../svn/subversion/mod_dav_svn/activity.c:87
#5  0x403fd753 in dav_svn_make_activity (resource=0x8126580)
    at ../svn/subversion/mod_dav_svn/version.c:584
#6  0x403dbef5 in dav_method_make_activity (r=0x80eafb0) at mod_dav.c:4074
#7  0x08090146 in ap_run_handler (r=0x80eafb0) at config.c:195
#8  0x0809061e in ap_invoke_handler (r=0x80eafb0) at config.c:401
#9  0x08080743 in ap_process_request (r=0x80eafb0) at http_request.c:288
#10 0x0807c945 in ap_process_http_connection (c=0x8125958) at http_core.c:293
#11 0x0809901a in ap_run_process_connection (c=0x8125958) at connection.c:85
#12 0x0808ed00 in child_main (child_num_arg=135434840) at prefork.c:696
#13 0x0808eea2 in make_child (s=0x80fe548, slot=0) at prefork.c:736
#14 0x0808eefb in startup_children (number_to_start=5) at prefork.c:808
#15 0x0808f5f1 in ap_mpm_run (_pconf=0x808e5e0, plog=0x80d7870, s=0x80fe548)
    at prefork.c:1024
#16 0x0809420c in main (argc=2, argv=0xbffffb94) at main.c:651

The relevant BDB code is

	if (!TXN_ON(dbenv)) {
		__db_err(dbenv,
    "DB_AUTO_COMMIT may not be specified in non-transactional environment");
		return (EINVAL);
	}


The AUTO_COMMIT flag is added by vt_db_open in apr_dbm_open.c.

-- 
Philip Martin

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Branko Čibej <br...@xbc.nu>.
Well, it turns out that BDB 4.1 _doesn't_ hang in 
fs-test:undelrify_deltify, it's just incredibly slow. I suspect this is 
because we're reading file contents 10 bytes at a time, but I have no 
idea why it's so much slower than BDB 4.0.


Here's a second version of this patch, slightly cleaned up. I moved 
svn_bdb__check_version into its own file, and I realised there's no need 
to remember the compile-time DB version in static variables -- those 
defines are constants, anyway. I also reverted the include of 
bdb_compat.h from the headers that didn't use any of its features.


Added support for building with both Berkeley DB 4.0.14 and 4.1.24.
Based on this patch by Justin Erenkrantz <je...@apache.org>:

    http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=22004

[ in subversion/libsvn_fs ]
* bdb/bdb_compat.h: New header. Definitions for BDB 4.0/4.1 compatibility.
* bdb/bdb_compat.c: New file. Implements svn_bdb__check_version.

* bdb/changes-table.c, bdb/copies-table.c, bdb/nodes-table.c, bdb/reps-table.c,
  bdb/rev-table.c, bdb/strings-table.c, bdb/txn-table.c:
Include "bdb_compat.h" instead of <db.h>. In calls to DB->open, wrap
the environment and transaction parameter in SVN_BDB_OPEN_PARAMS. Pass
the SVN_BDB_AUTO_COMMIT flag to DB->open and DB->put wherever the
transaction is NULL. Check the BDB version before each call to
db_create.

* bdb/changes-table.h: Include <db.h> instead of "db.h".

* fs.c: Include bdb/bdb_compat.h.
(check_db_version): New function.
(check_already_open): Extract version check into check_db_version.
(svn_fs_create_berkeley, svn_fs_open_berkeley): Call check_db_version.
(cleanup_fs_db, cleanup_fs): Make usage of DB_INCOMPLETE conditional.

* libsvn_fs.dsp: Add bdb/bdb_compat.c.

[top-level]
* subversion/mod_dav_svn/mod_dav_svn.dsp: Add bdb/bdb_compat.c.



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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Branko ÄŒibej <br...@xbc.nu> writes:
>
>>I think we shouldn't announce support for DBD 4.1 just yet; I'm
>>attaching this patch in the hope that people will test it on Unix
>>boxes. I'm testing it on Windows right now (with both BDB versions),
>>and will commit once some Unix test reports come in.
>>    
>>
>
>I have built this (a shared build) and run the regression tests over
>ra_local, the ra_dav tests are running right now.  BDB 4.1 needs an
>APRUTIL more recent than that in Apache 2.0.42.
>
Yes, that's one of the reasons why I don't think we should require BDB 
4.1 yet.

>>Index: subversion/libsvn_fs/bdb/bdb_compat.h
>>===================================================================
>>--- subversion/libsvn_fs/bdb/bdb_compat.h
>>+++ subversion/libsvn_fs/bdb/bdb_compat.h	2002-10-21 01:25:53.000000000 +0200
>>@@ -0,0 +1,81 @@
>>    
>>
>[snip]
>  
>
>>+/* Before calling db_create, we must check that the version of the BDB
>>+   libraries we're linking with is the same as the one we compiled
>>+   against, because the DB->open call is not binary compatible between
>>+   BDB 4.0 and 4.1. */
>>+static int svn_bdb__check_version (void)
>>+{
>>+  static const int compiled_major = DB_VERSION_MAJOR;
>>+  static const int compiled_minor = DB_VERSION_MINOR;
>>+  int linked_major, linked_minor;
>>+  db_version(&linked_major, &linked_minor, NULL);
>>+  if (compiled_major != linked_major
>>+      || compiled_minor != linked_minor)
>>+    return DB_OLD_VERSION;
>>+  return 0;
>>+}
>>    
>>
>
>Why is this function in a header file?  gcc issues a warning for every
>translation unit that includes the header but doesn't call the
>function.
>
Just lazyness on my part. I haven't found a nice place for that function 
in the bdb/ subdirectory yet. Maybe I'll just add a new file. Any ideas?

-- 
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: [PATCH] Support both BDB 4.0 and 4.1

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

> Philip Martin wrote:
>
>> $ svn mkdir http://localhost:8888/tmp/repo/foo2
>> ../svn/subversion/libsvn_ra_dav/util.c:163: (apr_err=120022, src_err=0)
>> svn: APR does not understand this error code
>> svn: failed to open activity db;  check repos perms.
>>
>> The error is coming from dav_svn_store_activity in mod_dav_svn,
>> apr_dbm_open fails to open /tmp/repo/dav/activities.
>>
> Hm, obviously we'll have to patch APR, too. Damn them for breaking the 
> API in a minor release, anyway.

Well, it looks like apr_dbm_berkeleydb.c already handles BDB 4.1 
correctly, except for the runtime version check -- which probalby isn't 
necessary anyway, since the soname of the library is different. Much 
weirdness.

-- 
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: [PATCH] Support both BDB 4.0 and 4.1

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Philip Martin <ph...@codematters.co.uk> writes:
>
>  
>
>>Branko ÄŒibej <br...@xbc.nu> writes:
>>
>>    
>>
>>>I think we shouldn't announce support for DBD 4.1 just yet; I'm
>>>attaching this patch in the hope that people will test it on Unix
>>>boxes. I'm testing it on Windows right now (with both BDB versions),
>>>and will commit once some Unix test reports come in.
>>>      
>>>
>>I have built this (a shared build) and run the regression tests over
>>ra_local, the ra_dav tests are running right now.  BDB 4.1 needs an
>>APRUTIL more recent than that in Apache 2.0.42.
>>    
>>
>
>The ra_dav regression tests fail.  I've spent a while rebuilding
>things to try to make sure I haven't done anything stupid, the tests
>work with BDB 4.0 and fail with BDB 4.1.  The only difference in the
>builds is the path given with --with-berkeley-db to Subversion and
>Apache/APR. I'm using Subversion r3421 with Branko's patch and
>Apache/APR from a couple of hours ago.
>
>The tests fail when mod_dav_svn writes to a repository, usually during
>the initial import of the greek tree.  For example, this works with
>BDB 4.0 and fails with BDB 4.1
>
>$ svnadmin create /tmp/repo
>$ svn mkdir file:///tmp/repo/foo1
>
>Committed revision 1.
>$ svn mkdir http://localhost:8888/tmp/repo/foo2
>../svn/subversion/libsvn_ra_dav/util.c:163: (apr_err=120022, src_err=0)
>svn: APR does not understand this error code
>svn: 
>failed to open activity db;  check repos perms.
>
>The error is coming from dav_svn_store_activity in mod_dav_svn,
>apr_dbm_open fails to open /tmp/repo/dav/activities.
>
Hm, obviously we'll have to patch APR, too. Damn them for breaking the 
API in a minor release, anyway.

-- 
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: [PATCH] Support both BDB 4.0 and 4.1

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> The ra_dav regression tests fail.  I've spent a while rebuilding
> things to try to make sure I haven't done anything stupid, the tests
> work with BDB 4.0 and fail with BDB 4.1.  The only difference in the
> builds is the path given with --with-berkeley-db to Subversion and
> Apache/APR. I'm using Subversion r3421 with Branko's patch and
> Apache/APR from a couple of hours ago.

This may be unrelated, but: I believe Ben had to backdate his APR due
to some socket code failures.  I don't know how far he backdated, but
he was having the problem with HEAD this afternoon, trying to run some
tests over dav.

It doesn't _look_ related to your error, though, so I don't know...

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Philip Martin <ph...@codematters.co.uk>.
Philip Martin <ph...@codematters.co.uk> writes:

> Branko Čibej <br...@xbc.nu> writes:
> 
> > I think we shouldn't announce support for DBD 4.1 just yet; I'm
> > attaching this patch in the hope that people will test it on Unix
> > boxes. I'm testing it on Windows right now (with both BDB versions),
> > and will commit once some Unix test reports come in.
> 
> I have built this (a shared build) and run the regression tests over
> ra_local, the ra_dav tests are running right now.  BDB 4.1 needs an
> APRUTIL more recent than that in Apache 2.0.42.

The ra_dav regression tests fail.  I've spent a while rebuilding
things to try to make sure I haven't done anything stupid, the tests
work with BDB 4.0 and fail with BDB 4.1.  The only difference in the
builds is the path given with --with-berkeley-db to Subversion and
Apache/APR. I'm using Subversion r3421 with Branko's patch and
Apache/APR from a couple of hours ago.

The tests fail when mod_dav_svn writes to a repository, usually during
the initial import of the greek tree.  For example, this works with
BDB 4.0 and fails with BDB 4.1

$ svnadmin create /tmp/repo
$ svn mkdir file:///tmp/repo/foo1

Committed revision 1.
$ svn mkdir http://localhost:8888/tmp/repo/foo2
../svn/subversion/libsvn_ra_dav/util.c:163: (apr_err=120022, src_err=0)
svn: APR does not understand this error code
svn: 
failed to open activity db;  check repos perms.

The error is coming from dav_svn_store_activity in mod_dav_svn,
apr_dbm_open fails to open /tmp/repo/dav/activities.

-- 
Philip Martin

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> I think we shouldn't announce support for DBD 4.1 just yet; I'm
> attaching this patch in the hope that people will test it on Unix
> boxes. I'm testing it on Windows right now (with both BDB versions),
> and will commit once some Unix test reports come in.

I have built this (a shared build) and run the regression tests over
ra_local, the ra_dav tests are running right now.  BDB 4.1 needs an
APRUTIL more recent than that in Apache 2.0.42.


> Index: subversion/libsvn_fs/bdb/bdb_compat.h
> ===================================================================
> --- subversion/libsvn_fs/bdb/bdb_compat.h
> +++ subversion/libsvn_fs/bdb/bdb_compat.h	2002-10-21 01:25:53.000000000 +0200
> @@ -0,0 +1,81 @@
[snip]
> +/* Before calling db_create, we must check that the version of the BDB
> +   libraries we're linking with is the same as the one we compiled
> +   against, because the DB->open call is not binary compatible between
> +   BDB 4.0 and 4.1. */
> +static int svn_bdb__check_version (void)
> +{
> +  static const int compiled_major = DB_VERSION_MAJOR;
> +  static const int compiled_minor = DB_VERSION_MINOR;
> +  int linked_major, linked_minor;
> +  db_version(&linked_major, &linked_minor, NULL);
> +  if (compiled_major != linked_major
> +      || compiled_minor != linked_minor)
> +    return DB_OLD_VERSION;
> +  return 0;
> +}

Why is this function in a header file?  gcc issues a warning for every
translation unit that includes the header but doesn't call the
function.

-- 
Philip Martin

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

Re: [PATCH] Support both BDB 4.0 and 4.1

Posted by Branko Čibej <br...@xbc.nu>.
Glenn A. Thompson wrote:

>  
>
>>meter in SVN_BDB_OPEN_PARAMS. Pass the
>>SVN_BDB_AUTO_COMMIT flag to DB->open and DB->put wherever the transaction
>>is NULL. Check the BDB version before each call to db_create.
>>v-help@subversion.tigris.org
>>    
>>
>
>Hey,
>
>I was reading up on the DB_AUTO_COMMIT flag.
>It seems to imply that the created transaction is commited after the command.  Is that
>true?
>I couldn't find where it said that explicitly.
>Anyone care to point me in the right direction?
>  
>
It's discussed in the docs for the various DB calls (DB->open, etc):

DB_AUTO_COMMIT
    Enclose the DB->open call within a transaction. If the call
    succeeds, the open operation will be recoverable. If the call fails,
    no database will have been created.

The fact that a failed call won't change anything in the database, and 
that a successful call will be recoverable, implies that the transaction 
is either committed (and checlpointed), or aborted.


-- 
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: [PATCH] Support both BDB 4.0 and 4.1

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

> meter in SVN_BDB_OPEN_PARAMS. Pass the
> SVN_BDB_AUTO_COMMIT flag to DB->open and DB->put wherever the transaction
> is NULL. Check the BDB version before each call to db_create.
> v-help@subversion.tigris.org

Hey,

I was reading up on the DB_AUTO_COMMIT flag.
It seems to imply that the created transaction is commited after the command.  Is that
true?
I couldn't find where it said that explicitly.
Anyone care to point me in the right direction?

Thanks,
gat



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