[Checkins] SVN: zc.zodbdgc/branches/dev/src/zc/zodbdgc/ Fixed a bug that caused batch deletes to fail and a bug in the tests
Jim Fulton
jim at zope.com
Thu May 28 17:26:19 EDT 2009
Log message for revision 100524:
Fixed a bug that caused batch deletes to fail and a bug in the tests
that hid the bug. :(
Changed:
U zc.zodbdgc/branches/dev/src/zc/zodbdgc/README.test
U zc.zodbdgc/branches/dev/src/zc/zodbdgc/__init__.py
-=-
Modified: zc.zodbdgc/branches/dev/src/zc/zodbdgc/README.test
===================================================================
--- zc.zodbdgc/branches/dev/src/zc/zodbdgc/README.test 2009-05-28 19:31:36 UTC (rev 100523)
+++ zc.zodbdgc/branches/dev/src/zc/zodbdgc/README.test 2009-05-28 21:26:18 UTC (rev 100524)
@@ -111,6 +111,15 @@
>>> transaction.commit()
+Must have more garbage!
+
+ >>> for i in range(10):
+ ... conn1.root()[i] = C()
+ >>> transaction.commit()
+ >>> for i in range(10):
+ ... del conn1.root()[i]
+ >>> transaction.commit()
+
The objects we just deleted are now garbage.
Time passes. :)
@@ -154,7 +163,7 @@
The number of objecs in the databases now:
>>> len(conn1._storage), len(conn2._storage), len(conn3._storage)
- (2207, 5, 4)
+ (2217, 5, 4)
>>> for d in db.databases.values():
... d.pack()
@@ -162,7 +171,7 @@
Packing doesn't change it:
>>> len(conn1._storage), len(conn2._storage), len(conn3._storage)
- (2207, 5, 4)
+ (2217, 5, 4)
>>> _ = conn1._storage.load(p64(2))
>>> _ = conn1._storage.load(p64(3))
@@ -189,6 +198,16 @@
... print name, u64(oid)
db1 2204
db1 2205
+ db1 2206
+ db1 2207
+ db1 2208
+ db1 2209
+ db1 2210
+ db1 2211
+ db1 2212
+ db1 2213
+ db1 2214
+ db1 2215
db2 1
db3 1
db3 2
@@ -202,7 +221,7 @@
haven't packed yet.
>>> len(conn1._storage), len(conn2._storage), len(conn3._storage)
- (2207, 5, 4)
+ (2217, 5, 4)
>>> now += 1
@@ -279,7 +298,7 @@
Ignoring index for 2.fs
Ignoring index for 3.fs
Using secondary configuration, config2, for analysis
- Removed 2 objects from db1
+ Removed 12 objects from db1
Removed 2 objects from db3
Removed 1 objects from db2
@@ -365,7 +384,7 @@
... d.close()
>>> zc.zodbdgc.check_command(['config2'])
- !!! db1 2206 db1 0
+ !!! db1 2216 db1 0
POSKeyError: 'No blob file'
!!! db2 2 db1 1
POSKeyError: 0x02
@@ -387,7 +406,7 @@
... """)
>>> zc.zodbdgc.check_command(['config2'])
- !!! db1 2206 db1 0
+ !!! db1 2216 db1 0
POSKeyError: 'No blob file'
!!! db2 2 db1 1
KeyError: 'db2'
@@ -418,7 +437,7 @@
... """)
>>> zc.zodbdgc.check_command(['config2'])
- !!! db1 2206 db1 0
+ !!! db1 2216 db1 0
POSKeyError: 'No blob file'
bad xref db2 2 db1 1
!!! db2 2 db1 1
Modified: zc.zodbdgc/branches/dev/src/zc/zodbdgc/__init__.py
===================================================================
--- zc.zodbdgc/branches/dev/src/zc/zodbdgc/__init__.py 2009-05-28 19:31:36 UTC (rev 100523)
+++ zc.zodbdgc/branches/dev/src/zc/zodbdgc/__init__.py 2009-05-28 21:26:18 UTC (rev 100524)
@@ -140,6 +140,7 @@
storage.tpc_finish(t)
t.commit()
t = transaction.begin()
+ storage.tpc_begin(t)
logger.info("Removed %s objects from %s", nd, name)
if nd:
More information about the Checkins
mailing list