Commit ef2f2d77 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fc61ff19
...@@ -83,7 +83,7 @@ import ( ...@@ -83,7 +83,7 @@ import (
) )
const traceDiff = true const traceDiff = true
const debugDiff = false const debugDiff = true
// ΔValue represents change in value. // ΔValue represents change in value.
type ΔValue struct { type ΔValue struct {
...@@ -334,6 +334,7 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t ...@@ -334,6 +334,7 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
δtkeycov = &RangedKeySet{} δtkeycov = &RangedKeySet{}
tracefDiff("\ntreediff %s δtops: %v δZTC: %v\n", root, δtops, δZTC) tracefDiff("\ntreediff %s δtops: %v δZTC: %v\n", root, δtops, δZTC)
tracefDiff(" trackSet: %v\n", trackSet)
defer tracefDiff("\n-> δT: %v\nδtrack: %v\nδtkeycov: %v\n", δT, δtrack, δtkeycov) defer tracefDiff("\n-> δT: %v\nδtrack: %v\nδtkeycov: %v\n", δT, δtrack, δtkeycov)
δtrackv := []*ΔPPTreeSubSet{} δtrackv := []*ΔPPTreeSubSet{}
...@@ -558,9 +559,10 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet) ...@@ -558,9 +559,10 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet)
// a is bucket -> δ- // a is bucket -> δ-
δA, err := diffB(ctx, a, nil); /*X*/if err != nil { return nil,nil,nil, err } δA, err := diffB(ctx, a, nil); /*X*/if err != nil { return nil,nil,nil, err }
err = δMerge(δ, δA); /*X*/if err != nil { return nil,nil,nil, err } err = δMerge(δ, δA); /*X*/if err != nil { return nil,nil,nil, err }
δtrack.Del.AddPath(ra.Path())
ar := KeyRange{ra.lo, ra.hi_} ar := KeyRange{ra.lo, ra.hi_}
δtrack.Del.AddPath(ra.Path())
δtkeycovADel.AddRange(ar) δtkeycovADel.AddRange(ar)
debugfDiff(" δtrack - %s %v\n", ar, ra.Path())
// Bkqueue <- ra.range // Bkqueue <- ra.range
Bktodo(ar) Bktodo(ar)
...@@ -633,6 +635,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet) ...@@ -633,6 +635,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet)
δtrack.δnchildNonLeafs[acOid] = nc δtrack.δnchildNonLeafs[acOid] = nc
} }
// XXX δtkeycov // XXX δtkeycov
// debugfDiff(" δtrack - %s %v\n", ar, ra.Path())
} }
continue continue
...@@ -687,9 +690,10 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet) ...@@ -687,9 +690,10 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet)
// δ <- δB // δ <- δB
err = δMerge(δ, δB); /*X*/if err != nil { return nil,nil,nil, err } err = δMerge(δ, δB); /*X*/if err != nil { return nil,nil,nil, err }
δtrack.Add.AddPath(b.Path())
br := KeyRange{b.lo, b.hi_} br := KeyRange{b.lo, b.hi_}
δtrack.Add.AddPath(b.Path())
δtkeycovBAdd.AddRange(br) δtkeycovBAdd.AddRange(br)
debugfDiff(" δtrack + %s %v\n", br, b.Path())
// Akqueue <- δB // Akqueue <- δB
Bkdone.AddRange(br) Bkdone.AddRange(br)
...@@ -726,10 +730,11 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet) ...@@ -726,10 +730,11 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet)
// δ <- δA // δ <- δA
err = δMerge(δ, δA); /*X*/if err != nil { return nil,nil,nil, err } err = δMerge(δ, δA); /*X*/if err != nil { return nil,nil,nil, err }
δtrack.Del.AddPath(a.Path()) δtrack.Del.AddPath(a.Path())
ar := KeyRange{a.lo, a.hi_} // NOTE *no* δtkeycovADel change here - A keys reached in phase 2 were not originally tracked.
δtkeycovADel.AddRange(ar) debugfDiff(" δtrack - [) %v\n", a.Path())
// Bkqueue <- a.range // Bkqueue <- a.range
ar := KeyRange{a.lo, a.hi_}
Akdone.AddRange(ar) Akdone.AddRange(ar)
Bktodo(ar) Bktodo(ar)
......
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