Commit 599a72f3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5f3946bd
...@@ -1346,14 +1346,15 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1346,14 +1346,15 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// watch was not previously established - set it up anew // watch was not previously established - set it up anew
// XXX locking // XXX locking
bfdir := wlink.head.bfdir head := wlink.head
bfdir := head.bfdir
f := bfdir.fileTab[foid] f := bfdir.fileTab[foid]
if f == nil { if f == nil {
// by "invalidation protocol" watch is setup after data file was opened // by "invalidation protocol" watch is setup after data file was opened
return fmt.Errorf("file not yet known or is not a ZBigFile") return fmt.Errorf("file not yet known or is not a ZBigFile")
} }
// XXX wait wlink.head.zconn.At() ≥ at // XXX wait head.zconn.At() ≥ at
// XXX <~> f.δtail.Head() ≥ at (?) // XXX <~> f.δtail.Head() ≥ at (?)
if at < bfdir.δFtail.Tail() { if at < bfdir.δFtail.Tail() {
...@@ -1367,22 +1368,17 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1367,22 +1368,17 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
bfdir.δFmu.RLock() bfdir.δFmu.RLock()
defer bfdir.δFmu.RUnlock() defer bfdir.δFmu.RUnlock()
/* XXX reenable // pin all tracked file blocks that were changed (at, head] range
for _, δfile := range bfdir.δFtail.SliceByFileRev(f, at, head.zconn.At()) {
// FIXME (!!!) since f.δtail does not have all changes to f, here we for _, blk := range δfile.Change {
// can be missing some pins we should be sending. (see wcfs_test.py for details)
for _, δ := range δFtail.SliceByRev(f, at, f.δtail.Head()) {
for _, blk := range δ.Changev {
_, already := toPin[blk] _, already := toPin[blk]
if already { if already {
continue continue
} }
// FIXME (!!!) again f.δtail can miss some entries toPin[blk], _ = f.LastBlkRev(ctx, blk, at)
toPin[blk], _ = f.LastBlkRev(blk, at)
} }
} }
*/
wg, ctx := errgroup.WithContext(ctx) wg, ctx := errgroup.WithContext(ctx)
for blk, rev := range toPin { for blk, rev := range toPin {
......
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