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

.

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