Commit a1490e33 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 124d15b7
......@@ -537,13 +537,13 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
// XXX errctx
job := &_RebuildJob{ready: make(chan struct{})}
trackNew := δTtail.trackNew
rebuildKeys := δTtail.ktrackNew
trackNew := δTtail.trackNew
ktrackNew := δTtail.ktrackNew
δTtail.trackNew = blib.PPTreeSubSet{}
δTtail.ktrackNew = blib.RangedKeySet{}
// krebuildJobs += rebuildKeys
for _, r := range rebuildKeys.AllRanges() {
// krebuildJobs += ktrackNew
for _, r := range ktrackNew.AllRanges() {
// XXX assert !krebuildJobs.IntersectsRange(e.KeyRange)
δTtail.krebuildJobs.SetRange(r, job)
}
......@@ -554,8 +554,8 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
vδTnew, δtrackSet, err := vδTBuild(root, trackNew, δBtail.δZtail, δBtail.db)
δBtail.mu.Lock()
// krebuildJobs -= rebuildKeys
for _, r := range rebuildKeys.AllRanges() {
// krebuildJobs -= ktrackNew
for _, r := range ktrackNew.AllRanges() {
// XXX assert krebuildJobs[r] == job
δTtail.krebuildJobs.DelRange(r)
}
......@@ -567,6 +567,13 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew)
δBtail.trackSet.UnionInplace(δtrackSet)
δBtail._vδBroots_Update(root, δrevSet)
} else {
// reinstate trackNew and ktrackNew back, so that data for those
// keys are tried to be rebuilt next time, not silently remain
// missing in vδT, i.e. corrupted.
δTtail.trackNew.UnionInplace(trackNew)
δTtail.ktrackNew.UnionInplace(&ktrackNew)
δBtail.trackNewRoots.Add(root)
}
// we are done
......
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