Commit e29f32d0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 811f8864
......@@ -667,6 +667,18 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
}
}
// adjust holeIdx
for k, δv := range δT {
if δv.Old == VDEL {
holeIdx.Del(k)
}
if δv.New == VDEL {
holeIdx.Add(k)
}
}
// XXX adjust trackIdx
return δT, nil
}
......
......@@ -494,7 +494,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
}
}
adj := SetKey{}; adj.Update(adj1); adj.Update(adj2)
adj := SetKey{}; adj.Add(k); adj.Update(adj1); adj.Update(adj2)
kadj[k] = adj
}
......@@ -621,11 +621,11 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
holes2.Add(k)
}
}
/* XXX reenable
///* XXX reenable
if !reflect.DeepEqual(holes2, δbtail.holeIdx.SetKey) {
badf("δbtail.holeIdx2 wrong ; holeIdx=%v holeIdxOK=%v", δbtail.holeIdx, holes2)
}
*/
//*/
// XXX verify δbtail index consistency against @at2
// XXX verify that removed keys remain in trackedIdx (holes), so that e.g.
......@@ -813,7 +813,7 @@ func TestΔBTail(t *testing.T) {
A{1: K(1),
3: K(3),
99: K(3,99),
oo: K(3,99)}),
oo: K(3,99,oo)}),
// XXX --------
// tree rotation
......@@ -827,37 +827,37 @@ func TestΔBTail(t *testing.T) {
// +1
Δ("T/B1:a",
A{1: K(1),
oo: K(1)}),
oo: K(1,oo)}),
// +2
Δ("T/B1:a,2:b",
A{1: K(1,2),
2: K(1,2),
oo: K(1,2)}),
oo: K(1,2,oo)}),
// -1
Δ("T/B2:b",
A{1: K(1,2),
2: K(1,2),
oo: K(1,2)}),
oo: K(1,2,oo)}),
// 2: b->c
Δ("T/B2:c",
A{2: K(2),
oo: K(2)}),
oo: K(2,oo)}),
// +1 in new bucket (to the left)
Δ("T2/B1:a-B2:c",
A{1: K(1,2),
2: K(2),
oo: K(2)}), // NOTE no ∞ -> 1, because 1 is added to the left
oo: K(2,oo)}), // NOTE no ∞ -> 1, because 1 is added to the left
// +3 in new bucket (to the right)
Δ("T2,3/B1:a-B2:c-B3:c",
A{1: K(1),
2: K(2),
3: K(2,3),
oo: K(2,3)}),
oo: K(2,3,oo)}),
// bucket split; +3 in new bucket
"T/B1:a,2:b",
......@@ -865,7 +865,7 @@ func TestΔBTail(t *testing.T) {
A{1: K(1,2,3),
2: K(1,2,3),
3: K(1,2,3),
oo: K(1,2,3)}),
oo: K(1,2,3,oo)}),
// bucket split; +3 in new bucket; +4 +5 in another new bucket
// which remain not tracked unless previously accessed.
......@@ -876,7 +876,7 @@ func TestΔBTail(t *testing.T) {
3: K(1,2,3),
4: K(1,2,3,4,5),
5: K(1,2,3,4,5),
oo: K(1,2,3,4,5)}),
oo: K(1,2,3,4,5,oo)}),
// reflow of keys: even if tracked={1}, changes to all B nodes need to be rescanned:
// +B12 forces to look in -B23 which adds -3 into δ, which
......@@ -890,7 +890,7 @@ func TestΔBTail(t *testing.T) {
5: K(1,2,3,4,5,6,7),
6: K(1,2,3,4,5,6,7),
7: K(1,2,3,4,5,6,7),
oo: K(1,2,3,4,5,6,7)}),
oo: K(1,2,3,4,5,6,7,oo)}),
// depth=2; bucket split; +3 in new bucket; left T remain
// _unchanged_ even though B under it is modified; right arm is
......@@ -900,7 +900,7 @@ func TestΔBTail(t *testing.T) {
A{1: K(1,2,3),
2: K(1,2,3),
3: K(1,2,3),
oo: K(1,2,3)}),
oo: K(1,2,3,oo)}),
// depth=2; like prev. case, but additional right arm with +4
// +5 is added which remain not tracked unless previously accessed.
......@@ -911,7 +911,7 @@ func TestΔBTail(t *testing.T) {
3: K(1,2,3),
4: K(1,2,3,4,5),
5: K(1,2,3,4,5),
oo: K(1,2,3,4,5)}),
oo: K(1,2,3,4,5,oo)}),
// depth=2; bucket split; +3 in new bucket; t0 and t1 split;
// +right arm (T7/B45-B89) which remain not tracked unless previously accessed.
......@@ -924,7 +924,7 @@ func TestΔBTail(t *testing.T) {
5: K(1,2,3,4,5),
8: K(1,2,3, 8,9),
9: K(1,2,3, 8,9),
oo: K(1,2,3, 8,9)}),
oo: K(1,2,3, 8,9,oo)}),
// 2 reflow to right B neighbour; 8 split into new B; δ=ø
......
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