Commit 912fa765 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 52871b8a
......@@ -932,7 +932,7 @@ retry:
}
file.size = size
bfdir.δFtail.Track(ctx, file, -1, sizePath, nil)
bfdir.δFtail.Track(file, -1, sizePath, nil)
// XXX we can miss a change to file if δblk is not yet tracked
// -> need to update file.rev at read time -> locking=XXX
......@@ -1469,7 +1469,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
bfdir := f.head.bfdir
δFtail := bfdir.δFtail
bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down?
δFtail.Track(ctx, f, blk, treepath, zblk) // XXX pass in zblk.rev here?
δFtail.Track(f, blk, treepath, zblk) // XXX pass in zblk.rev here?
bfdir.δFmu.Unlock()
// make sure that file[blk] on clients side stays as of @w.at state.
......@@ -2156,7 +2156,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
// only head/ needs δFtail, f.δtail and watches.
if head.rev == 0 {
head.bfdir.δFmu.Lock() // XXX locking ok?
head.bfdir.δFtail.Track(ctx, f, -1, sizePath, nil)
head.bfdir.δFtail.Track(f, -1, sizePath, nil)
head.bfdir.δFmu.Unlock()
// FIXME: scan zfile.blktab - so that we can detect all btree changes
......
......@@ -279,7 +279,7 @@ const (
// -> this requires to merge δc returned by diffT and adjust bChildren to tail into
// -> it will use less memory and offload Track from (re)loading leaf bucket
// ... for now we go more simple way
func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, path []Node, flags TrackFlags) error { // XXX Tree|Bucket; path[0] = root
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags TrackFlags) error { // XXX Tree|Bucket; path[0] = root
l := len(path)
if l == 0 {
panic("empty path")
......
......@@ -589,7 +589,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
if k == kInf {
trackFlags = TrackMaxKey
}
err = δbtail.Track(ctx, k, ok, path, trackFlags); X(err)
err = δbtail.Track(k, ok, path, trackFlags); X(err)
kadjTracked.Update(kadj[k])
}
......
......@@ -136,15 +136,13 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
// XXX text
//
// A root can be associated with several files (each provided on different Track call).
//
// XXX try to avoid ctx
func (δFtail *ΔFtail) Track(ctx context.Context, file *BigFile, blk int64, path []btree.LONode, zblk zBlk) {
func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zblk zBlk) {
δbTrackFlags := TrackFlags(0)
if blk == -1 {
// XXX blk = ∞ ?
δbTrackFlags = TrackMaxKey
}
err := δFtail.δBtail.Track(ctx, blk, zblk != nil, path, δbTrackFlags)
err := δFtail.δBtail.Track(blk, zblk != nil, path, δbTrackFlags)
if err != nil {
panic(err) // XXX -> error? errctx
}
......
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