Commit 33abf5f4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b0b62edc
...@@ -202,7 +202,7 @@ type ΔTree struct { ...@@ -202,7 +202,7 @@ type ΔTree struct {
} }
// _RebuildJob represents currently in-progress rebuilding job. XXX // _RebuildJob represents currently in-progress vδT rebuilding job.
// XXX place // XXX place
type _RebuildJob struct { type _RebuildJob struct {
ready chan struct{} // closed when job completes ready chan struct{} // closed when job completes
...@@ -316,15 +316,6 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() } ...@@ -316,15 +316,6 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// //
// XXX put keycov back to come first? // XXX put keycov back to come first?
func (δBtail *ΔBtail) Track(nodePath []Node, keycov KeyRange) { func (δBtail *ΔBtail) Track(nodePath []Node, keycov KeyRange) {
/* XXX kill
if traceΔBtail {
pathv := []string{}
for _, node := range nodePath { pathv = append(pathv, vnode(node)) }
tracefΔBtail("\nTrack %s %s\n", keycov, strings.Join(pathv, " -> "))
tracefΔBtail("trackSet: %s\n", δBtail.trackSet) // XXX locking
}
*/
head := δBtail.Head() head := δBtail.Head()
for _, node := range nodePath { for _, node := range nodePath {
nodeAt := node.PJar().At() nodeAt := node.PJar().At()
...@@ -393,16 +384,24 @@ func (δBtail *ΔBtail) track(path []zodb.Oid, keycov KeyRange) { ...@@ -393,16 +384,24 @@ func (δBtail *ΔBtail) track(path []zodb.Oid, keycov KeyRange) {
} }
return return
} }
// XXX also check if leaf ∈ trackNew ?
// XXX also check if keycov ∈ krebuildJobs
// queue path into trackNew // queue path into trackNew, if not there already
δTtail, ok := δBtail.byRoot[root] δTtail, ok := δBtail.byRoot[root]
if !ok { if !ok {
δTtail = newΔTtail() δTtail = newΔTtail()
δBtail.byRoot[root] = δTtail δBtail.byRoot[root] = δTtail
} }
if δTtail.trackNew.Has(leaf) {
tracefΔBtail("->T: nop\n")
path_ := δTtail.trackNew.Path(leaf)
if !pathEqual(path, path_) {
panicf("BUG: keyrange %s is already in trackNew via path=%v\ntrack requests path=%v", keycov, path_, path)
}
return
}
// XXX also check if keycov ∈ krebuildJobs
δBtail.trackNewRoots.Add(root) δBtail.trackNewRoots.Add(root)
δTtail.trackNew.AddPath(path) δTtail.trackNew.AddPath(path)
δTtail.ktrackNew.AddRange(keycov) δTtail.ktrackNew.AddRange(keycov)
...@@ -779,6 +778,7 @@ func vδTMerge1Inplace(pvδT *[]ΔTree, δT ΔTree) (newRevEntry bool) { ...@@ -779,6 +778,7 @@ func vδTMerge1Inplace(pvδT *[]ΔTree, δT ΔTree) (newRevEntry bool) {
δv_, already := δTcurr.KV[k] δv_, already := δTcurr.KV[k]
if already { if already {
if δv != δv_ { if δv != δv_ {
// TODO: return "conflict"
panicf("[%v] inconsistent δv:\nδTcurr: %v\nδT: %v", k, δTcurr, δT) panicf("[%v] inconsistent δv:\nδTcurr: %v\nδT: %v", k, δTcurr, δT)
} }
} else { } else {
......
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