[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - Full.py:1.44.2.6
Barry Warsaw
barry@wooz.org
Thu, 24 Oct 2002 16:19:23 -0400
Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv27987
Modified Files:
Tag: bdb-nolocks
Full.py
Log Message:
_doAbortVersion(): A slight rearrangement of the code based on the
nvrevid test. If the object was created in the version we're
aborting, set the lrevid to DNE, otherwise set it to the lrevid in the
non-version metadata record. We now pass checkRecoverAbortVersion().
=== ZODB3/bsddb3Storage/bsddb3Storage/Full.py 1.44.2.5 => 1.44.2.6 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/Full.py:1.44.2.5 Thu Oct 24 09:54:52 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/Full.py Thu Oct 24 16:19:22 2002
@@ -596,7 +596,7 @@
lrevid = tid
# Update the serials table, but if the transaction id is different
# than the serial number, we need to write our special long record
- if serial <> self._serial:
+ if serial <> tid:
self._serials.put(oid, serial+tid, txn=txn)
else:
self._serials.put(oid, serial, txn=txn)
@@ -685,18 +685,18 @@
meta = self._metadata[oid+tid]
curvid, nvrevid = unpack('>8s8s', meta[:16])
assert curvid == vid
- if nvrevid == ZERO:
- # This object was created in the version, so all we need
- # to do is to delete the record in the currentVersions
- # table.
- c.delete()
- rec = c.next()
- continue
- # Get the non-version data for the object
- nvmeta = self._metadata[oid+nvrevid]
- xcurvid, xnvrevid, lrevid = unpack('>8s8s8s', nvmeta[:24])
- assert xcurvid == ZERO
- assert xnvrevid == ZERO
+ if nvrevid <> ZERO:
+ # Get the non-version data for the object. We're mostly
+ # interested in the lrevid, i.e. the pointer to the pickle
+ # data in the non-version
+ nvmeta = self._metadata[oid+nvrevid]
+ xcurvid, xnvrevid, lrevid = unpack('>8s8s8s', nvmeta[:24])
+ assert xcurvid == ZERO
+ assert xnvrevid == ZERO
+ else:
+ # This object was created in the version, so there's no
+ # non-version data that might have an lrevid.
+ lrevid = DNE
# Write all the new data to the serials and metadata tables.
# Note that in an abortVersion the serial number of the object
# must be the serial number used in the non-version data,