[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - Full.py:1.44.2.9

Barry Warsaw barry@wooz.org
Fri, 1 Nov 2002 00:25:03 -0500


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

Modified Files:
      Tag: bdb-nolocks
	Full.py 
Log Message:
A pack implementation that passes all the tests.


=== ZODB3/bsddb3Storage/bsddb3Storage/Full.py 1.44.2.8 => 1.44.2.9 === (471/571 lines abridged)
--- ZODB3/bsddb3Storage/bsddb3Storage/Full.py:1.44.2.8	Wed Oct 30 16:05:47 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/Full.py	Fri Nov  1 00:25:02 2002
@@ -111,52 +111,6 @@
         #     16-byte value, in which case it will contain both the serial
         #     number and the tid pointer.
         #
-        # pickles -- {oid+serial -> pickle}
-        #     Maps the object revisions to the revision's pickle data.
-        #
-        # refcounts -- {oid -> count}
-        #     Maps the oid to the reference count for the object.  This
-        #     reference count is updated during the _finish() call.  In the
-        #     Full storage the refcounts include all the revisions of the
-        #     object, so it is never decremented except at pack time.  When it
-        #     goes to zero, the object is automatically deleted.
-        #
-        # oids -- [oid]
-        #     This is a list of oids of objects that are modified in the
-        #     current uncommitted transaction.
-        #
-        # pvids -- [vid]
-        #     This is a list of all the version ids that have been created in
-        #     the current uncommitted transaction.
-        #
-        # prevrevids -- {oid -> tid}
-        #     This is a list of previous revision ids for objects which are
-        #     modified by transactionalUndo in the current uncommitted
-        #     transaction.  It's necessary to properly handle multiple
-        #     transactionalUndo()'s in a single ZODB transaction.
-        #
-        # pending -- tid -> 'A' | 'C'
-        #     This is an optional flag which says what to do when the database
-        #     is recovering from a crash.  The flag is normally 'A' which
-        #     means any pending data should be aborted.  At the start of the
-        #     tpc_finish() this flag will be changed to 'C' which means, upon
-        #     recovery/restart, all pending data should be committed.  Outside
-        #     of any transaction (e.g. before the tpc_begin()), there will be
-        #     no pending entry.  It is a database invariant that if the
-        #     pending table is empty, the oids and pvids tables must also be
-        #     empty.
-        #
-        # vids -- {version_string -> vid}
-        #     Maps version strings (which are arbitrary) to vids.
-        #
-        # versions -- {vid -> version_string}
-        #     Maps vids to version strings.
-        #
-        # currentVersions -- {vid -> [oid + tid]}
-        #     Maps vids to the revids of the objects modified in that version
-        #     for all current versions (except the 0th version, which is the

[-=- -=- -=- 471 lines omitted -=- -=- -=-]

-        finally:
-            c.close()
-        # Zap currentVersions entries
-        c = self._currentVersions.cursor(txn=txn)
-        try:
-            for vid in vids.keys():
-                rec = c.set(vid)
-                while rec:
-                    cvid, revid = rec
-                    rec = c.next_dup()
-                    if cvid <> vid:
-                        break
-                    if rec[:8] == oid:
-                        c.delete()
-        finally:
-            c.close()
-        for vid in vids.keys():
-            pass
-        # Now zap txnoids entries
-        c = self._txnoids.cursor(txn=txn)
-        try:
-            for tid in tids.keys():
-                c.set_both(tid, oid)
-                c.delete()
-        finally:
-            c.close()
 
     #
     # GCable interface, for cyclic garbage collection (untested)
@@ -1706,7 +1613,10 @@
         try:
             oids = []
             oidkeys = {}
-            rec = c.set(tid)
+            try:
+                rec = c.set(tid)
+            except db.DBNotFoundError:
+                rec = None
             while rec:
                 # Ignore the key
                 oid = rec[1]
@@ -1736,7 +1646,7 @@
         # Ignore the index, since we expect .next() will raise the appropriate
         # IndexError when the iterator is exhausted.
         return self.next()
-        
+