Commit 8a2e57c5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 75777cca
......@@ -421,13 +421,20 @@ func (δBtail *ΔBtail) track(path []zodb.Oid, keycov KeyRange) {
// XXX inline into _Update1 ?
func (δBtail *ΔBtail) rebuildAll() (err error) {
defer xerr.Context(&err, "ΔBtail rebuildAll")
// XXX locking
// XXX locking correct?
δBtail.mu.Lock()
defer δBtail.mu.Unlock()
tracefΔBtail("\nRebuildAll @%s..@%s trackNewRoots: %s\n", δBtail.Tail(), δBtail.Head(), δBtail.trackNewRoots)
for root := range δBtail.trackNewRoots {
delete(δBtail.trackNewRoots, root)
δBtail.rebuild1(root)
δTtail := δBtail.byRoot[root] // must be there
err = δTtail._runRebuildJob(root, δBtail)
if err != nil {
return err
}
// delete(δBtail.trackNewRoots, root)
// δBtail.rebuild1(root) // XXX err
}
return nil
......@@ -532,6 +539,8 @@ func (δBtail *ΔBtail) vδTSnapForTracked(root zodb.Oid) (vδT []ΔTree, err er
//
// must be called with δBtail.mu locked.
// returns with δBtail.mu locked.
//
// XXX naming -> _rebuild1 ?
func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err error) {
// XXX errctx
job := &_RebuildJob{ready: make(chan struct{})}
......@@ -581,6 +590,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
return err
}
/*
// rebuild1 rebuilds ΔBtail for single root.
// XXX inline into rebuildAll ?
func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
......@@ -599,6 +609,7 @@ func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
δBtail._vδBroots_Update(root, δrevSet)
return nil
}
*/
// XXX move vδTBuild/vδTBuild1/Merge,Widen to after Update?
......
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