[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: BDB-4.4 and automatic database recovery

From: Branko Čibej <brane_at_xbc.nu>
Date: 2006-01-19 01:22:41 CET

Branko Čibej wrote:
> Grrr! I know what this is; the global pools that hold the cached BDB
> environment structs get destroyed before the not-so-global one from
> which the svn_fs_t was allocated. And I can't think of a way to fix
> that ordering... it could be that the only way to solve this one is to
> allocate the cached structs using malloc (they're reference-counted
> anyway).
Philip, could you please try with this (hacked-up) patch?

Index: subversion/libsvn_fs_base/bdb/env.c
===================================================================
--- subversion/libsvn_fs_base/bdb/env.c (revision 18165)
+++ subversion/libsvn_fs_base/bdb/env.c (working copy)
@@ -329,7 +329,7 @@
 
 
 /* Iniitalize the environment descriptor cache. */
-static svn_error_t *
+svn_error_t *
 bdb_cache_init (void)
 {
   /* We have to initialize the cache exactly once. Because APR
@@ -500,7 +500,6 @@
   bdb_env_t *bdb = bdb_baton->bdb;
 
   assert(bdb_baton->env == bdb_baton->bdb->env);
- SVN_ERR(bdb_cache_init());
 
   /* Neutralize bdb_baton's pool cleanup to prevent double-close. See
      cleanup_env_baton(). */
@@ -587,7 +586,6 @@
   bdb_env_t *bdb;
   svn_boolean_t panic;
 
- SVN_ERR(bdb_cache_init());
   acquire_cache_mutex();
 
   /* We can safely discard the open DB_CONFIG file handle. If the
Index: subversion/libsvn_fs_base/fs.c
===================================================================
--- subversion/libsvn_fs_base/fs.c (revision 18165)
+++ subversion/libsvn_fs_base/fs.c (working copy)
@@ -1227,6 +1227,7 @@
   svn_fs_base__id_parse
 };
 
+svn_error_t *bdb_cache_init (void);
 svn_error_t *
 svn_fs_base__init (const svn_version_t *loader_version,
                    fs_library_vtable_t **vtable)
@@ -1246,6 +1247,7 @@
                               loader_version->major);
   SVN_ERR (svn_ver_check_list (base_version(), checklist));
   SVN_ERR (check_bdb_version());
+ SVN_ERR (bdb_cache_init());
 
   *vtable = &library_vtable;
   return SVN_NO_ERROR;

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 19 03:12:54 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.