Commit 83b604f6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a1b94828
...@@ -932,7 +932,7 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) { ...@@ -932,7 +932,7 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
if int64(len(blkdata)) == blksize { if int64(len(blkdata)) == blksize {
func() { func() {
// store retrieved data back to OS cache for file @<rev>/file[blk] // store retrieved data back to OS cache for file @<rev>/file[blk]
blkrev, _ := f.δtail.LastRevOf(blk, f.head.zconn.At()) blkrev, _ := f.LastBlkRev(blk, f.head.zconn.At())
frev, frelease, err := groot.mkrevfile(blkrev, f.zfile.POid()) frev, frelease, err := groot.mkrevfile(blkrev, f.zfile.POid())
if err != nil { if err != nil {
log.Errorf("BUG: %s: invalidate blk #%d: %s (ignoring, but reading @revX/bigfile will be slow)", f.path(), blk, err) log.Errorf("BUG: %s: invalidate blk #%d: %s (ignoring, but reading @revX/bigfile will be slow)", f.path(), blk, err)
...@@ -1159,7 +1159,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre ...@@ -1159,7 +1159,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
bfdir.δFtail.Track(f, treepath) bfdir.δFtail.Track(f, treepath)
bfdir.δFmu.Unlock() bfdir.δFmu.Unlock()
blkrevmax, _ := f.δtail.LastRevOf(blk, f.zfile.PJar().At()) // XXX = f.head.zconn.At() blkrevmax, _ := f.LastBlkRev(blk, f.head.zconn.At())
blkrevmax = tidmin(blkrevmax, pathRevMax) blkrevmax = tidmin(blkrevmax, pathRevMax)
wg, ctx := errgroup.WithContext(ctx) wg, ctx := errgroup.WithContext(ctx)
...@@ -1271,7 +1271,7 @@ func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { ...@@ -1271,7 +1271,7 @@ func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
// XXX comment // XXX comment
// XXX file.δtail has not full info // XXX file.δtail has not full info
rev, _ = w.file.δtail.LastRevOf(blk, w.at) rev, _ = w.file.LastBlkRev(blk, w.at)
ack, err := w.link.sendReq(ctx, fmt.Sprintf("pin %s #%d @%s", foid, blk, rev)) ack, err := w.link.sendReq(ctx, fmt.Sprintf("pin %s #%d @%s", foid, blk, rev))
if err != nil { if err != nil {
...@@ -1305,7 +1305,8 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1305,7 +1305,8 @@ 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
f := wlink.head.bfdir.fileTab[foid] bfdir := wlink.head.bfdir
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")
...@@ -1316,13 +1317,14 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1316,13 +1317,14 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// XXX locking // XXX locking
if at < f.δtail.Tail() { if at < bfdir.δFtail.Tail() {
// XXX err += head.at? // XXX err += head.at?
return fmt.Errorf("at is too far away back from head/at") return fmt.Errorf("at is too far away back from head/at")
} }
toPin := map[int64]zodb.Tid{} // blk -> @rev toPin := map[int64]zodb.Tid{} // blk -> @rev
/* XXX reenable
// XXX f.δtail.Head() not neccessarily = head.At() // XXX f.δtail.Head() not neccessarily = head.At()
// (if f was not changed by a txn, f.δtail stays not updated) XXX correct? // (if f was not changed by a txn, f.δtail stays not updated) XXX correct?
// //
...@@ -1338,9 +1340,10 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1338,9 +1340,10 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
} }
// FIXME (!!!) again f.δtail can miss some entries // FIXME (!!!) again f.δtail can miss some entries
toPin[blk], _ = f.δtail.LastRevOf(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