[Zope3-checkins] CVS: Zope3/src/zodb/storage - bdbminimal.py:1.25

Tim Peters tim.one@comcast.net
Wed, 2 Jul 2003 11:41:48 -0400


Update of /cvs-repository/Zope3/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv29327

Modified Files:
	bdbminimal.py 
Log Message:
Removed all references to self._packing -- it had become a decoy.


=== Zope3/src/zodb/storage/bdbminimal.py 1.24 => 1.25 ===
--- Zope3/src/zodb/storage/bdbminimal.py:1.24	Mon Jun 30 18:41:21 2003
+++ Zope3/src/zodb/storage/bdbminimal.py	Wed Jul  2 11:41:46 2003
@@ -214,14 +214,6 @@
             if cs: cs.close()
         # We're done with this table
         self._pending.truncate(txn)
-        # If we're in the middle of a pack, we need to add to the packmark
-        # table any objects that were modified in this transaction.
-        # Otherwise, there's a race condition where mark might have happened,
-        # then the object is added, then sweep runs, deleting the object
-        # created in the interrim.
-        if self._packing:
-            for oid in self._oids.keys():
-                self._packmark.put(oid, PRESENT, txn=txn)
         self._oids.truncate(txn)
         # Now, to finish up, we need apply the refcount deltas to the
         # refcounts table, and do recursive collection of all refcount == 0
@@ -284,12 +276,6 @@
             assert len(references) % 8 == 0
             self._references.put(revid, references, txn=txn)
         self._oids.put(oid, PRESENT, txn=txn)
-        # If we're in the middle of a pack, we need to add these objects to
-        # the packmark, so a specific race condition won't collect them.
-        # E.g. we do a mark, then we do a store, then we sweep.  The objects
-        # stored between the mark and sweep would get collected away.
-        if self._packing:
-            self._packmark.put(oid, PRESENT, txn=txn)
         return newserial
 
     def store(self, oid, serial, data, refs, version, transaction):
@@ -411,13 +397,14 @@
         # _dostore() or _docommit(), so those never add anything to _packmark,
         # and only the correct oid-chasing code in _mark() populates
         # _packmark.
+        #
+        # Later:  All code referencing self._packing was removed.
         self._commit_lock_acquire()
         try:
             # We have to do this within a Berkeley transaction
             def clear_packmark(txn):
                 self._packmark.truncate(txn=txn)
             self._withtxn(clear_packmark)
-            self._packing = True
             # We don't wrap this in _withtxn() because we're going to do the
             # operation across several Berkeley transactions, which allows
             # other work to happen (stores and reads) while packing is being
@@ -427,7 +414,6 @@
             # collect object revisions
             self._dopack()
         finally:
-            self._packing = False
             self._packlock.release()
             self._commit_lock_release()
         self.log('pack finished')