Commit 8a150417 authored by Jim Fulton's avatar Jim Fulton

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.
parent d5a9f2e9
...@@ -25,6 +25,10 @@ Bugs Fixed ...@@ -25,6 +25,10 @@ Bugs Fixed
invalidation transaction ids matched the cached transaction ids invalidation transaction ids matched the cached transaction ids
should have been ignored. 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. - Conflict errors didn't invalidate ZEO cache entries.
- On Mac OS X, clients that connected and disconnected quickly could - On Mac OS X, clients that connected and disconnected quickly could
......
...@@ -1213,6 +1213,7 @@ class ClientStorage(object): ...@@ -1213,6 +1213,7 @@ class ClientStorage(object):
if had_blobs: if had_blobs:
self._check_blob_size(self._blob_data_bytes_loaded) self._check_blob_size(self._blob_data_bytes_loaded)
self._cache.setLastTid(tid)
self._tbuf.clear() self._tbuf.clear()
def undo(self, trans_id, txn): def undo(self, trans_id, txn):
...@@ -1341,6 +1342,11 @@ class ClientStorage(object): ...@@ -1341,6 +1342,11 @@ class ClientStorage(object):
self.finish_verification(pair) self.finish_verification(pair)
return "quick verification" return "quick verification"
elif ltid and ltid != utils.z64: 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) self._cache.setLastTid(ltid)
zope.event.notify(ZEO.interfaces.StaleCache(self)) zope.event.notify(ZEO.interfaces.StaleCache(self))
......
...@@ -673,7 +673,9 @@ class ClientCache(object): ...@@ -673,7 +673,9 @@ class ClientCache(object):
if ofs is None: if ofs is None:
# 0x10 == invalidate (miss) # 0x10 == invalidate (miss)
self._trace(0x10, oid, tid) self._trace(0x10, oid, tid)
return self.setLastTid(tid) if server_invalidation:
self.setLastTid(tid)
return
self.f.seek(ofs) self.f.seek(ofs)
read = self.f.read read = self.f.read
...@@ -699,7 +701,8 @@ class ClientCache(object): ...@@ -699,7 +701,8 @@ class ClientCache(object):
# 0x1C = invalidate (hit, saving non-current) # 0x1C = invalidate (hit, saving non-current)
self._trace(0x1C, oid, tid) self._trace(0x1C, oid, tid)
return self.setLastTid(tid) if server_invalidation:
self.setLastTid(tid)
## ##
# Generates (oid, serial) oairs for all objects in the # Generates (oid, serial) oairs for all objects in the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment