Commit 7a7c9756 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0917380e
...@@ -580,7 +580,8 @@ ABcov: ...@@ -580,7 +580,8 @@ ABcov:
// by default a node contributes to δ- // by default a node contributes to δ-
// a node ac does not contribute to δ- and can be skipped, if: // a node ac does not contribute to δ- and can be skipped, if:
// - ac is not tracked, or // - ac is not tracked, or
// - ac ∉ δZTC && ∃ bc from B: ac.oid == bc.oid (ac+ac.children were not changed, and ac stays in the tree) // - ac ∉ δZTC && ∃ bc from B: ac.oid == bc.oid && ac.keyrange == bc.keyrange
// (ac+ac.children were not changed, ac stays in the tree with the same key range coverage)
Aq := []*nodeInRange{atop} // queue for A nodes that contribute to δ- Aq := []*nodeInRange{atop} // queue for A nodes that contribute to δ-
for len(Aq) > 0 { for len(Aq) > 0 {
debugfDiff("\n") debugfDiff("\n")
...@@ -667,30 +668,39 @@ ABcov: ...@@ -667,30 +668,39 @@ ABcov:
} }
} }
if found { if found {
// ac can be skipped // ac can be skipped if key coverage stays the same
// adjust trackSet since path to the node could have changed ar := KeyRange{ac.lo, ac.hi_}
apath := ac.Path() br := KeyRange{bc.lo, bc.hi_}
bpath := bc.Path() if ar == br {
if !pathEqual(apath, bpath) { // adjust trackSet since path to the node could have changed
δtrack.Del.AddPath(apath) apath := ac.Path()
δtrack.Add.AddPath(bpath) bpath := bc.Path()
if nc := at.nchild; nc != 0 { if !pathEqual(apath, bpath) {
δtrack.δnchildNonLeafs[acOid] = nc δtrack.Del.AddPath(apath)
// XXX debugDiff δtrack [) ... δtrack.Add.AddPath(bpath)
if nc := at.nchild; nc != 0 {
δtrack.δnchildNonLeafs[acOid] = nc
// XXX debugDiff δtrack [) ...
}
} }
continue
} }
/*
// adjust δtkeycov only if it was leaf bucket // adjust δtkeycov only if it was leaf bucket
if nc := at.nchild; nc == 0 { if nc := at.nchild; nc == 0 {
ar := KeyRange{ac.lo, ac.hi_} ar := KeyRange{ac.lo, ac.hi_}
br := KeyRange{bc.lo, bc.hi_} br := KeyRange{bc.lo, bc.hi_}
δtkeycovADel.AddRange(ar) δtkeycovADel.AddRange(ar)
δtkeycovBAdd.AddRange(br) //δtkeycovBAdd.AddRange(br)
// XXX remove KKK vvv
debugfDiff(" δtrack - %s %v KKK\n", ar, apath) debugfDiff(" δtrack - %s %v KKK\n", ar, apath)
debugfDiff(" δtrack + %s %v KKK\n", br, bpath) debugfDiff(" δtrack + %s %v KKK\n", br, bpath)
} }
*/
continue // continue
} }
} }
......
...@@ -741,7 +741,8 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod ...@@ -741,7 +741,8 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
} }
} }
TrackedδZ = SetKey{} // Tracked ^ δZ // TrackedδZ = Tracked ^ δZ (i.e. a tracked node has changed, or its coverage was changed)
TrackedδZ = SetKey{}
for k := range initialTrackedKeys { for k := range initialTrackedKeys {
leaf1 := xkv1.Get(k) leaf1 := xkv1.Get(k)
oid1 := leaf1.oid oid1 := leaf1.oid
...@@ -753,7 +754,7 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod ...@@ -753,7 +754,7 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
if oid2 == zodb.InvalidOid { // embedded bucket if oid2 == zodb.InvalidOid { // embedded bucket
oid2 = leaf2.parent.oid oid2 = leaf2.parent.oid
} }
if δZset.Has(oid1) || δZset.Has(oid2) { if δZset.Has(oid1) || δZset.Has(oid2) || (KeyRange{leaf1.lo,leaf1.hi_} != KeyRange{leaf2.lo,leaf2.hi_}) {
TrackedδZ.Add(k) TrackedδZ.Add(k)
} }
} }
......
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