[Zodb-checkins] SVN: ZODB/trunk/src/ Bugs fixed

Jim Fulton jim at zope.com
Mon Aug 30 18:04:20 EDT 2010


Log message for revision 116044:
  Bugs 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/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZEO/ClientStorage.py
  U   ZODB/trunk/src/ZEO/cache.py

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2010-08-30 21:04:22 UTC (rev 116043)
+++ ZODB/trunk/src/CHANGES.txt	2010-08-30 22:04:20 UTC (rev 116044)
@@ -2,6 +2,16 @@
  Change History
 ================
 
+3.10.0b5 (2010-09-??)
+=====================
+
+Bugs 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.
+
 3.10.0b4 (2010-07-19)
 =====================
 

Modified: ZODB/trunk/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/trunk/src/ZEO/ClientStorage.py	2010-08-30 21:04:22 UTC (rev 116043)
+++ ZODB/trunk/src/ZEO/ClientStorage.py	2010-08-30 22:04:20 UTC (rev 116044)
@@ -1237,6 +1237,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):
@@ -1362,6 +1363,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/trunk/src/ZEO/cache.py
===================================================================
--- ZODB/trunk/src/ZEO/cache.py	2010-08-30 21:04:22 UTC (rev 116043)
+++ ZODB/trunk/src/ZEO/cache.py	2010-08-30 22:04:20 UTC (rev 116044)
@@ -676,7 +676,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
@@ -702,7 +704,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