Commit b039f763 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6cb0688e
...@@ -521,8 +521,11 @@ class tFile: ...@@ -521,8 +521,11 @@ class tFile:
if w is not None and w.at < blkrev: if w is not None and w.at < blkrev:
if cached == 1: if cached == 1:
# XXX assert blk already pinned on that watch # XXX assert blk already pinned on that watch
pass assert blk in w.pinned # XXX correct?
else: else:
assert cached == 0
assert blk not in w.pinned # cache is cleared only on invalidations
# XXX correct ^^^ ?
# XXX and watch not already pinned on the watch # XXX and watch not already pinned on the watch
pinok = {blk: t.tdb._blkRev(t.zf, blk, w.at)} pinok = {blk: t.tdb._blkRev(t.zf, blk, w.at)}
shouldPin = True shouldPin = True
...@@ -949,7 +952,6 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ? ...@@ -949,7 +952,6 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
twlink._watch(zf, at, pinok, "ok") twlink._watch(zf, at, pinok, "ok")
w.at = at w.at = at
# XXX update pinned
# _watch sends watch request for zf@at, expects initial pins specified by pinok and final reply. # _watch sends watch request for zf@at, expects initial pins specified by pinok and final reply.
# #
...@@ -1008,7 +1010,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str) ...@@ -1008,7 +1010,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
ev.append('pin ack pre') # XXX +details? ev.append('pin ack pre') # XXX +details?
for p in pinv: for p in pinv:
assert w.foid == p.foid assert w.foid == p.foid
if p.at is None: # repin to @head if p.at is None: # unpin to @head
assert p.blk in w.pinned # must have been pinned before XXX correct? assert p.blk in w.pinned # must have been pinned before XXX correct?
del w.pinned[p.blk] del w.pinned[p.blk]
else: else:
...@@ -1162,6 +1164,7 @@ def test_wcfs(): ...@@ -1162,6 +1164,7 @@ def test_wcfs():
wl._closeTX() wl._closeTX()
wg.go(_) wg.go(_)
wg.wait() wg.wait()
wl.close()
# invalid requests -> wcfs replies error # invalid requests -> wcfs replies error
wl = t.openwatch() wl = t.openwatch()
......
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