Commit b793437a authored by Jim Fulton's avatar Jim Fulton

remove a race when checking whether we need to update the cache tid after verification.

parent 20f81caa
...@@ -1390,12 +1390,13 @@ class ClientStorage(object): ...@@ -1390,12 +1390,13 @@ class ClientStorage(object):
server.verify(oid, tid) server.verify(oid, tid)
server.endZeoVerify() server.endZeoVerify()
if server_tid > self._cache.getLastTid(): with self._lock:
# We verified the cache, and got no new invalidations if server_tid > self._cache.getLastTid():
# while doing so. The records in the cache are valid, # We verified the cache, and got no new invalidations
# in that invalid current records were invalidated, # while doing so. The records in the cache are valid,
# but the last tid is wrong. Let's fix it: # in that invalid current records were invalidated,
self._cache.setLastTid(server_tid) # but the last tid is wrong. Let's fix it:
self._cache.setLastTid(server_tid)
return "full verification" return "full verification"
......
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