Commit d2ea1705 authored by Tim Peters's avatar Tim Peters

Merge rev 37790 from 3.4 branch.

More on collector 1847 (ZEO cache tracing).

simul.py hit NameErrors when startup cache verification
found data in the cache to invalidate.

The cache's loadBefore() implementation called _trace()
incorrectly, passing the tid where the version argument
belonged.
parent f196b7be
...@@ -203,7 +203,7 @@ class ClientCache(object): ...@@ -203,7 +203,7 @@ class ClientCache(object):
def loadBefore(self, oid, tid): def loadBefore(self, oid, tid):
L = self.noncurrent.get(oid) L = self.noncurrent.get(oid)
if L is None: if L is None:
self._trace(0x24, oid, tid) self._trace(0x24, oid, "", tid)
return None return None
# A pair with None as the second element is less than any pair with # A pair with None as the second element is less than any pair with
# the same first tid. Dubious: this relies on that None is less # the same first tid. Dubious: this relies on that None is less
...@@ -214,15 +214,15 @@ class ClientCache(object): ...@@ -214,15 +214,15 @@ class ClientCache(object):
# Therefore the largest start_tid < tid must be at L[i-1]. If i is 0, # Therefore the largest start_tid < tid must be at L[i-1]. If i is 0,
# there is no start_tid < tid: we don't have any data old enougn. # there is no start_tid < tid: we don't have any data old enougn.
if i == 0: if i == 0:
self._trace(0x24, oid, tid) self._trace(0x24, oid, "", tid)
return return
lo, hi = L[i-1] lo, hi = L[i-1]
assert lo < tid assert lo < tid
if tid > hi: # we don't have any data in the right range if tid > hi: # we don't have any data in the right range
self._trace(0x24, oid, tid) self._trace(0x24, oid, "", tid)
return None return None
o = self.fc.access((oid, lo)) o = self.fc.access((oid, lo))
self._trace(0x26, oid, tid) self._trace(0x26, oid, "", tid)
return o.data, o.start_tid, o.end_tid return o.data, o.start_tid, o.end_tid
## ##
......
...@@ -397,7 +397,7 @@ class CircularCacheSimulation(Simulation): ...@@ -397,7 +397,7 @@ class CircularCacheSimulation(Simulation):
if tid == z64: if tid == z64:
# This is part of startup cache verification: forget everything # This is part of startup cache verification: forget everything
# about this oid. # about this oid.
self._remove_noncurrent_revisions(oid, version) self._remove_noncurrent_revisions(oid)
cur_tid = self.current.get(oid) cur_tid = self.current.get(oid)
if cur_tid is None: if cur_tid is None:
...@@ -410,7 +410,7 @@ class CircularCacheSimulation(Simulation): ...@@ -410,7 +410,7 @@ class CircularCacheSimulation(Simulation):
del self.current[oid] del self.current[oid]
if tid == z64: if tid == z64:
# Startup cache verification: forget this oid entirely. # Startup cache verification: forget this oid entirely.
self._remove(oid, current_tid) self._remove(oid, cur_tid)
return return
# Our current data becomes non-current data. # Our current data becomes non-current data.
......
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