[Zodb-checkins] SVN: ZODB/branches/3.9/src/ Bug fixed:

Jim Fulton jim at zope.com
Mon Sep 20 14:52:15 EDT 2010


Log message for revision 116679:
  Bug fixed:
  
  - Shutting down a process while committing a transaction could cause
    ZEO client caches to have invalid data.  This, in turn caused stale
    data to remain in the cache until it was updated.
  

Changed:
  U   ZODB/branches/3.9/src/CHANGES.txt
  U   ZODB/branches/3.9/src/ZEO/ClientStorage.py
  U   ZODB/branches/3.9/src/ZEO/cache.py

-=-
Modified: ZODB/branches/3.9/src/CHANGES.txt
===================================================================
--- ZODB/branches/3.9/src/CHANGES.txt	2010-09-20 18:48:27 UTC (rev 116678)
+++ ZODB/branches/3.9/src/CHANGES.txt	2010-09-20 18:52:14 UTC (rev 116679)
@@ -25,6 +25,10 @@
   invalidation transaction ids matched the cached transaction ids
   should have been ignored.
 
+- Shutting down a process while committing a transaction could cause
+  ZEO client caches to have invalid data.  This, in turn caused stale
+  data to remain in the cache until it was updated.
+
 - Conflict errors didn't invalidate ZEO cache entries.
 
 - On Mac OS X, clients that connected and disconnected quickly could

Modified: ZODB/branches/3.9/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/branches/3.9/src/ZEO/ClientStorage.py	2010-09-20 18:48:27 UTC (rev 116678)
+++ ZODB/branches/3.9/src/ZEO/ClientStorage.py	2010-09-20 18:52:14 UTC (rev 116679)
@@ -1213,6 +1213,7 @@
             if had_blobs:
                 self._check_blob_size(self._blob_data_bytes_loaded)
 
+        self._cache.setLastTid(tid)
         self._tbuf.clear()
 
     def undo(self, trans_id, txn):
@@ -1341,6 +1342,11 @@
                 self.finish_verification(pair)
                 return "quick verification"
         elif ltid and ltid != utils.z64:
+
+            # XXX Hm, to have gotten here, the cache is non-empty, but
+            # it has no last tid. This doesn't seem like good situation.
+            # We shouldn't treat it so lightly.
+
             self._cache.setLastTid(ltid)
 
         zope.event.notify(ZEO.interfaces.StaleCache(self))

Modified: ZODB/branches/3.9/src/ZEO/cache.py
===================================================================
--- ZODB/branches/3.9/src/ZEO/cache.py	2010-09-20 18:48:27 UTC (rev 116678)
+++ ZODB/branches/3.9/src/ZEO/cache.py	2010-09-20 18:52:14 UTC (rev 116679)
@@ -673,7 +673,9 @@
         if ofs is None:
             # 0x10 == invalidate (miss)
             self._trace(0x10, oid, tid)
-            return self.setLastTid(tid)
+            if server_invalidation:
+                self.setLastTid(tid)
+            return
 
         self.f.seek(ofs)
         read = self.f.read
@@ -699,7 +701,8 @@
             # 0x1C = invalidate (hit, saving non-current)
             self._trace(0x1C, oid, tid)
 
-        return self.setLastTid(tid)
+        if server_invalidation:
+            self.setLastTid(tid)
 
     ##
     # Generates (oid, serial) oairs for all objects in the



More information about the Zodb-checkins mailing list