Commit 1c21d16e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d4848186
......@@ -45,6 +45,8 @@ const debugPPSet = false
// returns path to tree node given node oid.
//
// Every node in the set comes with .parent pointer.
//
// XXX we only allow single parent/root case and report "tree corrupt" otherwise.
type PPTreeSubSet map[zodb.Oid]*nodeInTree
// nodeInTree represents tracking information about a node.
......@@ -352,8 +354,8 @@ func (orig PPTreeSubSet) Clone() PPTreeSubSet {
return klon
}
// equal returns whether a == b.
func (A PPTreeSubSet) equal(B PPTreeSubSet) bool {
// Equal returns whether a == b.
func (A PPTreeSubSet) Equal(B PPTreeSubSet) bool {
if len(A) != len(B) {
return false
}
......
......@@ -175,12 +175,10 @@ type ΔBtail struct {
// TODO allow client to optionally provide zconnOld/zconnNew on e.g. Update()
db *zodb.DB // to open connections to load new/old tree|buckets
// tracked nodes index: node -> parent + accessed holes under this node XXX -> holeIdx
// we only allow single parent/root case and report "tree corrupt" otherwise.
// trackIdx describes @head state
trackIdx PPTreeSubSet // XXX -> trackSet
// set of tracked nodes as of @head state.
trackSet PPTreeSubSet
// tree(s) subset that was requested to be tracked, but for which vδB was not yet rebuilt
// set of node that were requested to be tracked, but for which vδB was not yet rebuilt
trackNew PPTreeSubSet
// XXX root -> tracked holes
......@@ -247,7 +245,7 @@ func NewΔBtail(at0 zodb.Tid, db *zodb.DB) *ΔBtail {
return &ΔBtail{
δZtail: zodb.NewΔTail(at0),
byRoot: map[zodb.Oid]*ΔTtail{},
trackIdx: PPTreeSubSet{},
trackSet: PPTreeSubSet{},
trackNew: PPTreeSubSet{},
holeIdxByRoot: map[zodb.Oid]treeSetKey{},
db: db,
......@@ -264,8 +262,8 @@ func (orig *ΔBtail) clone() *ΔBtail {
klon.δZtail.Append(δZ.Rev, δZ.Changev)
}
// trackIdx, trackNew
klon.trackIdx = orig.trackIdx.Clone()
// trackSet, trackNew
klon.trackSet = orig.trackSet.Clone()
klon.trackNew = orig.trackNew.Clone()
// byRoot
......@@ -334,7 +332,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
for _, node := range path { pathv = append(pathv, vnode(node)) }
tracef("Track [%v] %s\n", key, strings.Join(pathv, " -> "))
// δBtail.trackIdx.AddNodePath(path)
δBtail.trackNew.AddNodePath(path)
// track is track of path[-1] (i.e. leaf)
......@@ -409,7 +406,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
tracef("\nrebuild @%s <- @%s\n", atPrev, δZ.Rev)
tracef("δZ:\t%v\n", δZ.Changev)
tracef("trackNew: %v\n", trackNew)
tracef("trackIdx: %v\n", δBtail.trackIdx) // XXX needed?
tracef("trackSet: %v\n", δBtail.trackSet) // XXX needed?
defer tracef("\n\n")
// XXX len(δtopsByRoot) == 0 -> skip
......@@ -482,12 +479,12 @@ func (δBtail *ΔBtail) rebuild() (err error) {
}
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
// Remap it back to @head and merge to .trackIdx
// Remap it back to @head and merge to .trackSet
for _, δtrack := range vδtrack {
δtrack.Reverse() // we saved it as lo<-hi; now we go lo->hi
trackNew.ApplyΔ(δtrack)
}
δBtail.trackIdx.UnionInplace(trackNew)
δBtail.trackSet.UnionInplace(trackNew)
return nil
}
......@@ -505,19 +502,19 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
headOld := δBtail.Head()
defer xerr.Contextf(&err, "ΔBtail update %s -> %s", headOld, δZ.Tid)
// update .trackIdx and vδB from .trackNew
// update .trackSet and vδB from .trackNew
δBtail.rebuild()
tracef("Update @%s -> @%s\n", δBtail.Head(), δZ.Tid)
tracef("δZ:\t%v\n", δZ.Changev)
tracef("trackIdx: %v\n", δBtail.trackIdx)
tracef("trackSet: %v\n", δBtail.trackSet)
tracef("holeIdxByRoot: %v\n", δBtail.holeIdxByRoot)
// XXX dup wrt rebuild?
δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackIdx)
δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackSet)
δB := ΔB{Rev: δZ.Tid, ByRoot: make(map[zodb.Oid]map[Key]ΔValue)}
......@@ -541,7 +538,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
for root, δtops := range δtopsByRoot {
holeIdx := δBtail.holeIdxByRoot[root]
δT, δtrack, err := treediff(ctx, root, δtops, δZTC, δBtail.trackIdx, holeIdx, zconnOld, zconnNew)
δT, δtrack, err := treediff(ctx, root, δtops, δZTC, δBtail.trackSet, holeIdx, zconnOld, zconnNew)
if err != nil {
return ΔB{}, err
}
......@@ -573,7 +570,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
// XXX rebuild lastRevOf
}
δBtail.trackIdx.ApplyΔ(δtrack)
δBtail.trackSet.ApplyΔ(δtrack)
}
return δB, nil
......@@ -808,15 +805,15 @@ func (rs rangeSplit) String() string {
// treediff computes δT/δtrack for tree/trackIdx specified by root in between old..new.
// treediff computes δT/δtrack for tree/trackSet specified by root in between old..new.
//
// δtops is set of top nodes for changed subtrees.
// δZTC is connected(δZ/T) - connected closure for subset of δZ(old..new) that
// touches tracked nodes of T.
//
// XXX holeIdx is updated XXX -> return similarly to δtrack
// XXX ^^^ -> but better kill holeIdx and do everything only via trackIdx
func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, trackIdx PPTreeSubSet, holeIdx treeSetKey, zconnOld, zconnNew *zodb.Connection) (δT map[Key]ΔValue, δtrack *ΔPPTreeSubSet, err error) {
// XXX ^^^ -> but better kill holeIdx and do everything only via trackSet
func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, trackSet PPTreeSubSet, holeIdx treeSetKey, zconnOld, zconnNew *zodb.Connection) (δT map[Key]ΔValue, δtrack *ΔPPTreeSubSet, err error) {
defer xerr.Contextf(&err, "treediff %s..%s %s", zconnOld.At(), zconnNew.At(), root)
tracef("\ntreediff %s δtops: %v δZTC: %v\n", root, δtops, δZTC)
......@@ -833,7 +830,7 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
return nil, nil, err
}
δtop, δtrackTop, err := diffX(ctx, a, b, δZTC, trackIdx, holeIdx)
δtop, δtrackTop, err := diffX(ctx, a, b, δZTC, trackSet, holeIdx)
if err != nil {
return nil, nil, err
}
......@@ -862,7 +859,7 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
}
}
// adjust trackIdx by merge(δtrackTops)
// adjust trackSet by merge(δtrackTops)
δtrack = &ΔPPTreeSubSet{Del: PPTreeSubSet{}, Add: PPTreeSubSet{}, δnchildNonLeafs: map[zodb.Oid]int{}}
for _, δ := range δtrackv {
δtrack.Update(δ)
......@@ -880,9 +877,9 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
//
// a/b can be nil; a=nil means addition, b=nil means deletion.
//
// δtrackIdx is trackIdx δ that needs to be applied to trackIdx to keep it
// δtrack is trackSet δ that needs to be applied to trackSet to keep it
// consistent with b (= a + δ).
func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx PPTreeSubSet, holeIdx treeSetKey) (δ map[Key]ΔValue, δtrackIdx *ΔPPTreeSubSet, err error) {
func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackSet PPTreeSubSet, holeIdx treeSetKey) (δ map[Key]ΔValue, δtrack *ΔPPTreeSubSet, err error) {
if a==nil && b==nil {
panic("BUG: both a & b == nil")
}
......@@ -917,7 +914,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx PPTreeSubSet,
}
if isT {
return diffT(ctx, aT, bT, δZTC, trackIdx, holeIdx)
return diffT(ctx, aT, bT, δZTC, trackSet, holeIdx)
} else {
var δtrack *ΔPPTreeSubSet
δ, err := diffB(ctx, aB, bB)
......@@ -932,7 +929,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx PPTreeSubSet,
//
// a, b point to top of subtrees @old and @new revisions.
// δZTC is connected set of objects covering δZT (objects changed in this tree in old..new).
func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet, holeIdx treeSetKey) (δ map[Key]ΔValue, δtrack *ΔPPTreeSubSet, err error) {
func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet, holeIdx treeSetKey) (δ map[Key]ΔValue, δtrack *ΔPPTreeSubSet, err error) {
tracef(" diffT %s %s\n", xidOf(A), xidOf(B))
defer xerr.Contextf(&err, "diffT %s %s", xidOf(A), xidOf(B))
......@@ -945,10 +942,10 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
// path prefix to A and B
prefix := []zodb.Oid{}
t := trackIdx[A.POid()]
t := trackSet[A.POid()]
for t.parent != zodb.InvalidOid {
prefix = append([]zodb.Oid{t.parent}, prefix...)
t = trackIdx[t.parent]
t = trackSet[t.parent]
}
// initial split ranges for A and B
......@@ -978,8 +975,8 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
// {} oid -> parent for all nodes in Bv: current and previously expanded - up till top B
// XXX requires A.oid == B.oid
BtrackIdx := PPTreeSubSet{}
BtrackIdx.AddPath(trackIdx.Path(B.POid()))
BtrackSet := PPTreeSubSet{}
BtrackSet.AddPath(trackSet.Path(B.POid()))
// phase 1: expand A top->down driven by δZTC.
// by default a node contributes to δ-
......@@ -1029,7 +1026,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
achildren := Av.Expand(ra)
for _, ac := range achildren {
acOid := ac.node.POid()
at, tracked := trackIdx[acOid]
at, tracked := trackSet[acOid]
if !tracked && /*cannot skip embedded bucket:*/acOid != zodb.InvalidOid {
continue
}
......@@ -1040,7 +1037,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
// ( this does not give exact answer but should be a reasonable heuristic;
// the diff is the same if heuristic does not work and we
// look into and load more nodes to compute δ )
_, found := BtrackIdx[acOid]
_, found := BtrackSet[acOid]
if !found {
for {
blo := Bv.Get(ac.lo)
......@@ -1059,7 +1056,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
bchildren := Bv.Expand(blo)
for _, bc := range bchildren {
bcOid := bc.node.POid()
BtrackIdx.AddPath(bc.Path())
BtrackSet.AddPath(bc.Path())
if acOid == bcOid {
found = true
}
......@@ -1073,9 +1070,9 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx PPTreeSubSet,
// ac can be skipped
// XXX Bkqueue <- holes(ac.range \ bc.range) XXX test for this
// adjust trackIdx since path to the node could have changed
apath := trackIdx.Path(acOid)
bpath := BtrackIdx.Path(acOid)
// adjust trackSet since path to the node could have changed
apath := trackSet.Path(acOid)
bpath := BtrackSet.Path(acOid)
if !pathEqual(apath, bpath) {
δtrack.Del.AddPath(apath)
δtrack.Add.AddPath(bpath)
......
......@@ -312,20 +312,19 @@ func (rbs RBucketSet) holeIdx(tracked SetKey) SetKey {
return holes
}
// trackIdx returns what should be ΔBtree.trackIdx for specified tracked key set.
// XXX -> trackSet
func (rbs RBucketSet) trackIdx(tracked SetKey) PPTreeSubSet {
trackIdx := PPTreeSubSet{}
// trackSet returns what should be ΔBtree.trackSet for specified tracked key set.
func (rbs RBucketSet) trackSet(tracked SetKey) PPTreeSubSet {
trackSet := PPTreeSubSet{}
for k := range tracked {
kb := rbs.Get(k)
// trackIdx explicitly records only regular buckets.
// trackSet explicitly records only regular buckets.
// embedded buckets all have oid=zodb.InvalidOid and would lead to z
newNode := false
if kb.oid != zodb.InvalidOid {
track, already := trackIdx[kb.oid]
track, already := trackSet[kb.oid]
if !already {
track = &nodeInTree{parent: kb.parent.oid, nchild: 0}
trackIdx[kb.oid] = track
trackSet[kb.oid] = track
newNode = true
}
if track.parent != kb.parent.oid {
......@@ -340,11 +339,11 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) PPTreeSubSet {
ppoid = p.parent.oid
}
pt, already := trackIdx[p.oid]
pt, already := trackSet[p.oid]
newParent := false
if !already {
pt = &nodeInTree{parent: ppoid, nchild: 0}
trackIdx[p.oid] = pt
trackSet[p.oid] = pt
newParent = true
}
if pt.parent != ppoid {
......@@ -358,7 +357,7 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) PPTreeSubSet {
newNode = newParent
}
}
return trackIdx
return trackSet
}
......@@ -749,13 +748,13 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
badf("δbtail.holeIdx1 wrong ; holeIdx=%v holeIdxOK=%v", holeIdx, holes1)
}
// verify δbtail.trackIdx against @at1
// trackIdx1 = xkv1[tracked1]
trackIdx1 := xkv1.trackIdx(initialTrackedKeys)
// if !reflect.DeepEqual(trackIdx1, δbtail.trackIdx) {
// badf("δbtail.trackIdx1 wrong:\n\thave: %v\n\twant: %v", δbtail.trackIdx, trackIdx1)
// verify δbtail.trackSet against @at1
// trackSet1 = xkv1[tracked1]
trackSet1 := xkv1.trackSet(initialTrackedKeys)
// if !reflect.DeepEqual(trackSet1, δbtail.trackSet) {
// badf("δbtail.trackSet1 wrong:\n\thave: %v\n\twant: %v", δbtail.trackSet, trackSet1)
// }
δbtail.assertTrack(t, "1", /*ø*/PPTreeSubSet{}, trackIdx1)
δbtail.assertTrack(t, "1", /*ø*/PPTreeSubSet{}, trackSet1)
// δB <- δZ
......@@ -772,13 +771,13 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
badf("δbtail.holeIdx2 wrong ; holeIdx=%v holeIdxOK=%v", holeIdx, holes2)
}
// verify δbtail.trackIdx against @at2
// trackIdx2 = xkv2[tracked2] ( = xkv2[kadj[tracked1]]
trackIdx2 := xkv2.trackIdx(kadjTracked)
// if !reflect.DeepEqual(trackIdx2, δbtail.trackIdx) {
// badf("δbtail.trackIdx2 wrong:\n\thave: %v\n\twant: %v", δbtail.trackIdx, trackIdx2)
// verify δbtail.trackSet against @at2
// trackSet2 = xkv2[tracked2] ( = xkv2[kadj[tracked1]]
trackSet2 := xkv2.trackSet(kadjTracked)
// if !reflect.DeepEqual(trackSet2, δbtail.trackSet) {
// badf("δbtail.trackSet2 wrong:\n\thave: %v\n\twant: %v", δbtail.trackSet, trackSet2)
// }
δbtail.assertTrack(t, "2", trackIdx2, /*ø*/PPTreeSubSet{})
δbtail.assertTrack(t, "2", trackSet2, /*ø*/PPTreeSubSet{})
// assert δB.ByRoot == {treeRoot -> ...} if δTok != ø
......@@ -838,22 +837,21 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
}
}
// assertTrack verifies that trackIdx == trackIdxOK.
// assertTrack verifies that trackSet == trackSetOK.
// XXX place
func assertTrack(t *testing.T, subj string, trackIdx, trackIdxOK PPTreeSubSet) {
func assertTrack(t *testing.T, subj string, trackSet, trackSetOK PPTreeSubSet) {
t.Helper()
// eq := reflect.DeepEqual(trackIdx, trackIdxOK) // slower
eq := trackIdx.equal(trackIdxOK)
eq := trackSet.Equal(trackSetOK)
if !eq {
t.Errorf("%s:\n\thave: %v\n\twant: %v", subj, trackIdx, trackIdxOK)
t.Errorf("%s:\n\thave: %v\n\twant: %v", subj, trackSet, trackSetOK)
}
}
// assertTrack verifies state of .trackIdx and .trackNew.
// assertTrack verifies state of .trackSet and .trackNew.
// XXX place
func (δbtail *ΔBtail) assertTrack(t *testing.T, subj string, trackIdxOK, trackNewOK PPTreeSubSet) {
func (δbtail *ΔBtail) assertTrack(t *testing.T, subj string, trackSetOK, trackNewOK PPTreeSubSet) {
t.Helper()
assertTrack(t, subj + ": trackIdx", δbtail.trackIdx, trackIdxOK)
assertTrack(t, subj + ": trackSet", δbtail.trackSet, trackSetOK)
assertTrack(t, subj + ": trackNew", δbtail.trackNew, trackNewOK)
// XXX also verify .holeIdx XXX or better get rid of .holeIdx
......@@ -908,24 +906,24 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
t.Run(fmt.Sprintf(" T%s;R", keys1), func(t *testing.T) {
δbtail := NewΔBtail(t0.at, db)
// assert trackIdx=ø, trackNew=ø, vδB=[]
// assert trackSet=ø, trackNew=ø, vδB=[]
δbtail.assertTrack(t, "@at0", ø, ø) // XXX + vδB
xverifyΔBTail_rebuild_U(t, δbtail, t0, t1, xat, /*trackIdx=*/ø)
xverifyΔBTail_rebuild_U(t, δbtail, t0, t1, xat, /*trackSet=*/ø)
xverifyΔBTail_rebuild_TR(t, db, δbtail, t1, treeRoot, xat,
// after Track(keys1)
keys1,
/*trackIdx=*/ ø,
/*trackNew=*/ t1.xkv.trackIdx(keys1),
/*trackSet=*/ ø,
/*trackNew=*/ t1.xkv.trackSet(keys1),
// after rebuild
/*trackIdx=*/ t1.xkv.trackIdx(keys1_0),
/*trackSet=*/ t1.xkv.trackSet(keys1_0),
/*vδT=*/ δkv1_1)
t.Run((" →" + t2.tree), func(t *testing.T) {
// tracked keys1 becomes tracked keys1_2 after Update(t1->t2)
keys1_2 := kadj12.Map(keys1)
xverifyΔBTail_rebuild_U(t, δbtail, t1, t2, xat, /*trackIdx=*/t2.xkv.trackIdx(keys1_2))
xverifyΔBTail_rebuild_U(t, δbtail, t1, t2, xat, /*trackSet=*/t2.xkv.trackSet(keys1_2))
// tRestKeys2 = tAllKeys - keys1
tRestKeys2 := tAllKeys.Difference(keys1)
......@@ -959,12 +957,12 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
xverifyΔBTail_rebuild_TR(t, db, δbtail_, t2, treeRoot, xat,
// after Track(keys2)
keys2,
// FIXME vvv trackNew should not cover ranges that are already in trackIdx
/*trackIdx*/ t2.xkv.trackIdx(keys1_0.Union(keys1_2)),
/*trackNew*/ t2.xkv.trackIdx(keys2),
// FIXME vvv trackNew should not cover ranges that are already in trackSet
/*trackSet*/ t2.xkv.trackSet(keys1_0.Union(keys1_2)),
/*trackNew*/ t2.xkv.trackSet(keys2),
// after rebuild
/* trackIdx=*/ t2.xkv.trackIdx(keys12_0),
/* trackSet=*/ t2.xkv.trackSet(keys12_0),
/*vδT=*/ δkv1_2, δkv2_2)
// })
}
......@@ -975,7 +973,7 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
}
// xverifyΔBTail_rebuild_U verifies ΔBTree state after Update(ti->tj).
func xverifyΔBTail_rebuild_U(t *testing.T, δbtail *ΔBtail, ti, tj *tTreeCommit, xat map[zodb.Tid]string, trackIdx PPTreeSubSet) {
func xverifyΔBTail_rebuild_U(t *testing.T, δbtail *ΔBtail, ti, tj *tTreeCommit, xat map[zodb.Tid]string, trackSet PPTreeSubSet) {
t.Helper()
X := exc.Raiseif
ø := PPTreeSubSet{}
......@@ -983,12 +981,12 @@ func xverifyΔBTail_rebuild_U(t *testing.T, δbtail *ΔBtail, ti, tj *tTreeCommi
// Update ati -> atj
δB, err := δbtail.Update(tj.δZ); X(err)
// XXX assert δB.Rev = tj.at; δB = δ(ti,tj)/initially tracked
δbtail.assertTrack(t, fmt.Sprintf("after Update(@%s→@%s)", xat[ti.at], xat[tj.at]), trackIdx, ø)
δbtail.assertTrack(t, fmt.Sprintf("after Update(@%s→@%s)", xat[ti.at], xat[tj.at]), trackSet, ø)
_ = δB
}
// xverifyΔBTail_rebuild_TR verifies ΔBTree state after Track(keys) + rebuild.
func xverifyΔBTail_rebuild_TR(t *testing.T, db *zodb.DB, δbtail *ΔBtail, tj *tTreeCommit, treeRoot zodb.Oid, xat map[zodb.Tid]string, keys SetKey, trackIdx PPTreeSubSet, trackNew, trackIdxAfterRebuild PPTreeSubSet,vδTok ...map[Key]Δstring) {
func xverifyΔBTail_rebuild_TR(t *testing.T, db *zodb.DB, δbtail *ΔBtail, tj *tTreeCommit, treeRoot zodb.Oid, xat map[zodb.Tid]string, keys SetKey, trackSet PPTreeSubSet, trackNew, trackSetAfterRebuild PPTreeSubSet,vδTok ...map[Key]Δstring) {
t.Helper()
X := exc.Raiseif
ø := PPTreeSubSet{}
......@@ -1004,12 +1002,12 @@ func xverifyΔBTail_rebuild_TR(t *testing.T, db *zodb.DB, δbtail *ΔBtail, tj *
err = δbtail.Track(k, ok, path); X(err)
}
δbtail.assertTrack(t, fmt.Sprintf("@%s: after Track%v", xat[tj.at], keys), trackIdx, trackNew)
δbtail.assertTrack(t, fmt.Sprintf("@%s: after Track%v", xat[tj.at], keys), trackSet, trackNew)
// XXX vδB=[ø]
δbtail.rebuild()
δbtail.assertTrack(t, fmt.Sprintf("@%s: after Track%v + rebuild", xat[tj.at], keys), trackIdxAfterRebuild, ø)
δbtail.assertTrack(t, fmt.Sprintf("@%s: after Track%v + rebuild", xat[tj.at], keys), trackSetAfterRebuild, ø)
// XXX assert vδB=[δ1/T(keys)]
// XXX verify Get
......@@ -1434,12 +1432,12 @@ func TestΔBTail(t *testing.T) {
"T/T1/T-T/B0:g-B1:e,2:d,3:h",
"T1/T-T3/B0:g-T-T/B1:e,2:d-B3:h",
// was leading to wrongly computed trackIdx2 due to top not
// was leading to wrongly computed trackSet2 due to top not
// being tracked to tree root.
"T/T1/B0:a-B1:b",
"T/T1/T-T/B0:c-B1:d",
// was leading to wrongly computed trackIdx2: leaf bucket not
// was leading to wrongly computed trackSet2: leaf bucket not
// reparented to root.
"T/T/B0:a",
"T/B0:a",
......@@ -1450,7 +1448,7 @@ func TestΔBTail(t *testing.T) {
// ---- found by AllStructs ----
// trackIdx2 wrongly computed due to top not being tracked to tree root
// trackSet2 wrongly computed due to top not being tracked to tree root
"T2/T1-T/B0:g-B1:b-T/B2:b,3:a",
"T2/T1-T/T-T-B2:a/B0:c-B1:g",
......@@ -1462,7 +1460,7 @@ func TestΔBTail(t *testing.T) {
"T1/T-T2/T-B1:c-B2:c/B0:g",
"T1/T-T/B0:g-T/B1:e",
// trackIdx corruption: oid is pointed by some .parent but is not present
// trackSet corruption: oid is pointed by some .parent but is not present
"T1/T-T/B0:g-T2/B1:h-B2:g",
"T/T1/T-T2/B0:e-B1:f-B2:g",
......
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