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