[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - CommitLog.py:1.12

Barry Warsaw barry@wooz.org
Wed, 28 Aug 2002 17:11:43 -0400


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

Modified Files:
	CommitLog.py 
Log Message:
write_nonversion_object(): This method is used to record abortVersions
and it is subtly different than the `o' opcode.  The serial number of
objects in the non-version after an abortVersion should be the last
serial number of the object before it was modified in the version.

This actually breaks the symmetry between serial numbers and
transaction ids, so it must be handled specially.


=== ZODB3/bsddb3Storage/bsddb3Storage/CommitLog.py 1.11 => 1.12 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/CommitLog.py:1.11	Fri Aug 23 13:11:27 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/CommitLog.py	Wed Aug 28 17:11:43 2002
@@ -341,8 +341,12 @@
     #           actually higher level API method that write essentially the
     #           same record with some of the elements defaulted to the empty
     #           string or the "all-zeros" string.
-    #     'x' - Like 'o' but might have slightly different semantics in the
-    #           individual databases.
+    #     'a' - Like 'o' but used in abortVersion transaction so that the
+    #           object's serial number doesn't appear to change after the
+    #           abortVersion.
+    #     'x' - Like 'o', but doesn't write a metadata record during _finish
+    #           since the metadata record was written optimistically during
+    #           the store() call.
     #     'v' - new version record, consisting of a version string and a
     #           version id
     #     'd' - discard version, consisting of a version id
@@ -391,7 +395,7 @@
         # Write zeros for the vid and nvrevid since we're storing this object
         # into version zero (the non-version).  Also, write an empty pickle
         # since we'll reuse one already in the pickle table.
-        self._append('o', (oid, zero, zero, lrevid, None, prevrevid))
+        self._append('a', (oid, zero, zero, lrevid, None, prevrevid))
 
     def write_moved_object(self, oid, vid, nvrevid, lrevid, prevrevid):
         # Write an empty pickle since we're just moving the object and we'll
@@ -421,6 +425,6 @@
             key, data = rec
         except ValueError:
             raise LogCorruptedError, 'incomplete record'
-        if key not in 'xovdr':
+        if key not in 'xovdra':
             raise LogCorruptedError, 'bad record key: %s' % key
         return key, data