[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - BerkeleyBase.py:1.25

Barry Warsaw barry@wooz.org
Thu, 21 Nov 2002 14:51:55 -0500


Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv5694

Modified Files:
	BerkeleyBase.py 
Log Message:
BerkeleyConfig: I think a reasonable checkpoint interval is 2 minutes.

Jim suggests that autopack never do a full gc'ing pack by default, so
let's set the classicpack default to zero.

__init__(): Pass the absolute path to the DB environment's db_home  as
the name argument to the base class constructor.  This gives a unique
value for sortKeys().

env_from_string(): Keith Bostic suggests we stick with DB_RECOVER.


=== ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py 1.24 => 1.25 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py:1.24	Tue Nov 19 14:48:33 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/BerkeleyBase.py	Thu Nov 21 14:51:55 2002
@@ -119,14 +119,14 @@
       never automatically do classic packs.  For Minimal storage, this value
       is ignored -- all packs are classic packs.
     """
-    interval = 0
+    interval = 120
     kbyte = 0
     min = 0
     logdir = None
     cachesize = 128 * 1024 * 1024
     frequency = 0
     packtime = 4 * 60 * 60
-    classicpack = 24
+    classicpack = 0
 
 
 
@@ -181,7 +181,11 @@
         else:
             self._env = env
 
-        BaseStorage.__init__(self, name)
+        # Use the absolute path to the environment directory as the name.
+        # This should be enough of a guarantee that sortKey() -- which via
+        # BaseStorage uses the name -- is globally unique.
+        envdir = os.path.abspath(self._env.db_home)
+        BaseStorage.__init__(self, envdir)
 
         # Instantiate a pack lock
         self._packlock = ThreadLock.allocate_lock()
@@ -398,7 +402,7 @@
     env.set_cachesize(gbytes, bytes)
     env.open(envname,
              db.DB_CREATE          # create underlying files as necessary
-             | db.DB_RECOVER_FATAL # run normal recovery before opening
+             | db.DB_RECOVER       # run normal recovery before opening
              | db.DB_INIT_MPOOL    # initialize shared memory buffer pool
              | db.DB_INIT_TXN      # initialize transaction subsystem
              | db.DB_THREAD        # we use the environment from other threads