Commit ef2f2d77 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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