Commit 95d96a58 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 488ce5e1
......@@ -194,7 +194,8 @@ class tDB:
# ZBigFile(s) scheduled for commit
t._changed = {} # ZBigFile -> {} blk -> data
# committed: head + δF history
# committed: (tail, head] + δF history
t.tail = t.root._p_jar.db().storage.lastTransaction()
t.head = None
t._headv = [] # XXX -> just use dFtail[·].rev ?
t.dFtail = [] # of DF
......@@ -760,8 +761,9 @@ def watch(twlink, zf, at): # XXX -> ?
# _watch sends watch request for zf@at, expects initial pins specified by pinok, and finaly reply.
#
# pinok: {} blk -> at that have to be pinned.
# if replyok ends with '…' only reply prefix until the dots is checked.
@func(tWatchLink)
def _watch(twlink, zf, at, pinok, reply):
def _watch(twlink, zf, at, pinok, replyok):
# send watch request and check that we receive pins for in-cache blocks
# changed > at. Use timeout to detect wcfs replying less pins than expected.
......@@ -788,7 +790,12 @@ def _watch(twlink, zf, at, pinok, reply):
wg.go(_)
def _(ctx):
assert twlink.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == reply
reply = twlink.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at)))
if replyok.endswith('…'):
rok = replyok[:-len('…')]
assert reply[:len(rok)] == rok
else:
assert reply == replyok
# cancel _expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel()
......@@ -925,7 +932,9 @@ def test_wcfs():
# watch with @at < δtail.tail -> rejected
print('\n\nAAA\n\n')
wl = t.openwatch()
wl._watch(zf, p64(u64(at0)-1), {}, "errXXX")
atpast = p64(u64(t.tail)-1)
wl._watch(zf, atpast, {}, "error setup watch f<%s> @%s: too far away back from"
" head/at (@%s); …" % (h(zf._p_oid), h(atpast), h(t.head)))
wl.close()
return # XXX
......
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