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

[PATCH] Add Berkeley DB 4.1.24 support

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-09-20 23:29:40 CEST

I'm purposely going to ignore whether we should drop support for
4.0 and move to 4.1 or support both at the same time. That's not
my call - I think we should move to 4.1.24 due to the number of
fixes present in 4.1 - listed here:

http://www.sleepycat.com/update/4.1.24/if.4.1.24.html

But, that might be a tad painful (supposedly it is backwards
compatible file-wise - just not API-wise).

This passes 'make check' for me. -- justin

Add support for Berkeley DB 4.1.24.

* subversion/libsvn_fs/bdb/txn-table.c (svn_fs__open_transactions_table)
  subversion/libsvn_fs/bdb/reps-table.c (svn_fs__open_reps_table),
  subversion/libsvn_fs/bdb/copies-table.c (svn_fs__open_copies_table),
  subversion/libsvn_fs/bdb/strings-table.c (svn_fs__open_strings_table),
  subversion/libsvn_fs/bdb/rev-table.c (svn_fs__open_revisions_table),
  subversion/libsvn_fs/bdb/changes-table.c (svn_fs__open_changes_table),
  subversion/libsvn_fs/bdb/nodes-table.c (svn_fs__open_nodes_table),
  Pass NULL Transaction ID and DB_AUTO_COMMIT to open.
  Pass DB_AUTO_COMMIT to txns->put when no transaction is passed.

* subversion/libsvn_fs/fs.c (cleanup_fs_db, cleanup_fs):
  Remove references to obsolete DB_INCOMPLETE error.

Index: subversion/libsvn_fs/bdb/txn-table.c
===================================================================
--- subversion/libsvn_fs/bdb/txn-table.c
+++ subversion/libsvn_fs/bdb/txn-table.c 2002-09-19 23:43:33.840001000 -0700
@@ -46,8 +46,8 @@
   DB *txns;
 
   DB_ERR (db_create (&txns, env, 0));
- DB_ERR (txns->open (txns, "transactions", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (txns->open (txns, NULL, "transactions", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                       0666));
 
   /* Create the `next-id' table entry. */
@@ -59,7 +59,7 @@
                        svn_fs__str_to_dbt (&key,
                                            (char *) svn_fs__next_key_key),
                        svn_fs__str_to_dbt (&value, (char *) "0"),
- 0));
+ DB_AUTO_COMMIT));
   }
 
   *transactions_p = txns;
Index: subversion/libsvn_fs/bdb/reps-table.c
===================================================================
--- subversion/libsvn_fs/bdb/reps-table.c
+++ subversion/libsvn_fs/bdb/reps-table.c 2002-09-19 23:43:05.180007000 -0700
@@ -38,8 +38,8 @@
   DB *reps;
 
   DB_ERR (db_create (&reps, env, 0));
- DB_ERR (reps->open (reps, "representations", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (reps->open (reps, NULL, "representations", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                       0666));
 
   /* Create the `next-key' table entry. */
@@ -51,7 +51,7 @@
             (reps, 0,
              svn_fs__str_to_dbt (&key, (char *) svn_fs__next_key_key),
              svn_fs__str_to_dbt (&value, (char *) "0"),
- 0));
+ DB_AUTO_COMMIT));
   }
 
   *reps_p = reps;
Index: subversion/libsvn_fs/bdb/copies-table.c
===================================================================
--- subversion/libsvn_fs/bdb/copies-table.c
+++ subversion/libsvn_fs/bdb/copies-table.c 2002-09-19 23:42:39.600010000 -0700
@@ -38,8 +38,8 @@
   DB *copies;
 
   DB_ERR (db_create (&copies, env, 0));
- DB_ERR (copies->open (copies, "copies", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (copies->open (copies, NULL, "copies", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                         0666));
 
   /* Create the initial `next-id' table entry. */
@@ -50,7 +50,7 @@
                          svn_fs__str_to_dbt (&key,
                                              (char *) svn_fs__next_key_key),
                          svn_fs__str_to_dbt (&value, (char *) "0"),
- 0));
+ DB_AUTO_COMMIT));
   }
 
   *copies_p = copies;
Index: subversion/libsvn_fs/bdb/strings-table.c
===================================================================
--- subversion/libsvn_fs/bdb/strings-table.c
+++ subversion/libsvn_fs/bdb/strings-table.c 2002-09-19 23:43:29.590017000 -0700
@@ -41,9 +41,9 @@
      multiple records. Note: this must occur before ->open(). */
   DB_ERR (strings->set_flags (strings, DB_DUP));
 
- DB_ERR (strings->open (strings, "strings", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
- 0666));
+ DB_ERR (strings->open (strings, NULL, "strings", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
+ 0666));
 
   if (create)
   {
@@ -54,7 +54,7 @@
             (strings, 0,
              svn_fs__str_to_dbt (&key, (char *) svn_fs__next_key_key),
              svn_fs__str_to_dbt (&value, (char *) "0"),
- 0));
+ DB_AUTO_COMMIT));
   }
   
   *strings_p = strings;
Index: subversion/libsvn_fs/bdb/rev-table.c
===================================================================
--- subversion/libsvn_fs/bdb/rev-table.c
+++ subversion/libsvn_fs/bdb/rev-table.c 2002-09-19 23:43:25.590000000 -0700
@@ -34,8 +34,8 @@
   DB *revisions;
 
   DB_ERR (db_create (&revisions, env, 0));
- DB_ERR (revisions->open (revisions, "revisions", 0, DB_RECNO,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (revisions->open (revisions, NULL, "revisions", 0, DB_RECNO,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                            0666));
 
   *revisions_p = revisions;
Index: subversion/libsvn_fs/bdb/changes-table.c
===================================================================
--- subversion/libsvn_fs/bdb/changes-table.c
+++ subversion/libsvn_fs/bdb/changes-table.c 2002-09-19 23:42:30.640011000 -0700
@@ -45,8 +45,8 @@
      one-per-row. Note: this must occur before ->open(). */
   DB_ERR (changes->set_flags (changes, DB_DUP));
 
- DB_ERR (changes->open (changes, "changes", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (changes->open (changes, NULL, "changes", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                          0666));
 
   *changes_p = changes;
Index: subversion/libsvn_fs/bdb/nodes-table.c
===================================================================
--- subversion/libsvn_fs/bdb/nodes-table.c
+++ subversion/libsvn_fs/bdb/nodes-table.c 2002-09-19 23:42:50.660011000 -0700
@@ -44,8 +44,8 @@
   DB *nodes;
 
   DB_ERR (db_create (&nodes, env, 0));
- DB_ERR (nodes->open (nodes, "nodes", 0, DB_BTREE,
- create ? (DB_CREATE | DB_EXCL) : 0,
+ DB_ERR (nodes->open (nodes, NULL, "nodes", 0, DB_BTREE,
+ (create ? (DB_CREATE | DB_EXCL) : 0) | DB_AUTO_COMMIT,
                        0666));
 
   /* Create the `next-id' table entry (use '1' because '0' is
@@ -58,7 +58,7 @@
                         svn_fs__str_to_dbt (&key,
                                             (char *) svn_fs__next_key_key),
                         svn_fs__str_to_dbt (&value, (char *) "1"),
- 0));
+ DB_AUTO_COMMIT));
   }
 
   *nodes_p = nodes;
Index: subversion/libsvn_fs/fs.c
===================================================================
--- subversion/libsvn_fs/fs.c
+++ subversion/libsvn_fs/fs.c 2002-09-19 01:21:48.590003000 -0700
@@ -104,15 +104,6 @@
       *db_ptr = 0;
       db_err = db->close (db, 0);
 
- /* We can ignore DB_INCOMPLETE on db->close and db->sync; it
- * just means someone else was using the db at the same time
- * we were. See the Berkeley documentation at:
- * http://www.sleepycat.com/docs/ref/program/errorret.html#DB_INCOMPLETE
- * http://www.sleepycat.com/docs/api_c/db_close.html
- */
- if (db_err == DB_INCOMPLETE)
- db_err = 0;
-
       SVN_ERR (DB_WRAP (fs, msg, db_err));
     }
 
@@ -141,12 +132,6 @@
   {
     int db_err = env->txn_checkpoint (env, 0, 0, 0);
 
- while (db_err == DB_INCOMPLETE)
- {
- apr_sleep (APR_USEC_PER_SEC * 1);
- db_err = env->txn_checkpoint (env, 0, 0, 0);
- }
-
     /* If the environment was not (properly) opened, then txn_checkpoint
        will typically return EINVAL. Ignore this case.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 20 23:30:18 2002

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.