[Zodb-checkins] CVS: Packages/BTrees - MergeTemplate.c:1.16.16.1

Tim Peters tim.one at comcast.net
Sat Mar 26 00:07:34 EST 2005


Update of /cvs-repository/Packages/BTrees
In directory cvs.zope.org:/tmp/cvs-serv23963/BTrees

Modified Files:
      Tag: Zope-2_7-branch
	MergeTemplate.c 
Log Message:
Backport from ZODB 3.3.

Collector #1734.  Critical bug in BTree conflict resolution.

Stop silent data loss in some BTree cases where a transaction adds
a new key to a bucket while a concurrent transaction deletes all
keys from the same bucket.


=== Packages/BTrees/MergeTemplate.c 1.16 => 1.16.16.1 ===
--- Packages/BTrees/MergeTemplate.c:1.16	Fri Jan 17 12:20:49 2003
+++ Packages/BTrees/MergeTemplate.c	Sat Mar 26 00:07:02 2005
@@ -60,6 +60,13 @@
   SetIteration i1 = {0,0,0}, i2 = {0,0,0}, i3 = {0,0,0};
   int cmp12, cmp13, cmp23, mapping, set;
 
+  /* If either "after" bucket is empty, punt. */
+  if (s2->len == 0 || s3->len == 0)
+    {
+      merge_error(-1, -1, -1, 12);
+      goto err;
+    }
+
   if (initSetIteration(&i1, OBJECT(s1), 1) < 0) goto err;
   if (initSetIteration(&i2, OBJECT(s2), 1) < 0) goto err;
   if (initSetIteration(&i3, OBJECT(s3), 1) < 0) goto err;



More information about the Zodb-checkins mailing list