Commit a39d91af authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4fe7b39c
......@@ -313,7 +313,9 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
// go backwards and merge vδT <- treediff(lo..hi/trackNew)
vδZ := δZtail.Data()
// vδtrack := []*ΔPPTreeSubSet{}
for {
δtkeycov := &RangedKeySet{} // all keys coming into tracking set during this lo..hi scan
trackNewCur := trackNew.Clone()
for i := len(vδZ)-1; i>=0; i-- {
δZ := vδZ[i]
......@@ -326,18 +328,34 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
atPrev = δZtail.Tail()
}
δtrackNew, δtkeycov, err := δTtail.rebuild1(atPrev, δZ, trackNew, db)
δtrackNew, δtkeycov_, err := δTtail.rebuild1(atPrev, δZ, trackNewCur, db)
if err != nil {
return nil, err
}
trackNew.ApplyΔ(δtrackNew)
// FIXME use δtkeycov to recompute track coverage
_ = δtkeycov
trackNewCur.ApplyΔ(δtrackNew)
δtkeycov.UnionInplace(δtkeycov_)
// XXX update .KVAtTail, .lastRevOf
}
// an iteration closer to tail may turn out to add a key to the tracking set
// we have to recheck all entries past that revision for changes to that key
// for example:
//
// XXX
//
// restart from head and cycle until set of tracked keys does not grow anymore
if δtkeycov.Empty() {
break
}
for _, r := δtkeycov.AllRanges() {
}
}
/*
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
// Remap it back to @head and merge to .trackSet
......@@ -346,8 +364,9 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
trackNew.ApplyΔ(δtrack)
}
δBtail.trackSet.UnionInplace(trackNew)
*/
return δtrackSet, nil
*/
return trackNew
}
// rebuild1 rebuilds δT for single δZ.
......
......@@ -160,7 +160,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb
// XXX blk = ∞ from beginning ?
blk = xbtree.KeyMax
}
err := δFtail.δBtail.Track(blk, zblk != nil, path)
err := δFtail.δBtail.Track(blk, path)
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