Commit 7d530bbc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c09ba806
...@@ -566,7 +566,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er ...@@ -566,7 +566,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
δTtail.vδT = vδTClone(δTtail.vδT) δTtail.vδT = vδTClone(δTtail.vδT)
δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew) δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew)
δBtail.trackSet.UnionInplace(δtrackSet) δBtail.trackSet.UnionInplace(δtrackSet)
δBtail.vδBroots_Update(root, δrevSet) δBtail._vδBroots_Update(root, δrevSet)
} }
// we are done // we are done
...@@ -590,7 +590,7 @@ func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error { ...@@ -590,7 +590,7 @@ func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
δTtail.vδT = vδTClone(δTtail.vδT) δTtail.vδT = vδTClone(δTtail.vδT)
δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew) δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew)
δBtail.trackSet.UnionInplace(δtrackSet) δBtail.trackSet.UnionInplace(δtrackSet)
δBtail.vδBroots_Update(root, δrevSet) δBtail._vδBroots_Update(root, δrevSet)
return nil return nil
} }
...@@ -878,7 +878,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -878,7 +878,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δTtail.vδT = vδTClone(δTtail.vδT) δTtail.vδT = vδTClone(δTtail.vδT)
δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew) δrevSet := vδTMergeInplace(&δTtail.vδT, vδTnew)
δBtail.trackSet.UnionInplace(δtrackSet) δBtail.trackSet.UnionInplace(δtrackSet)
δBtail.vδBroots_Update(root, δrevSet) δBtail._vδBroots_Update(root, δrevSet)
} }
// build δB. Even if δT=ø after _Update1, but δtkeycov1 != ø, above // build δB. Even if δT=ø after _Update1, but δtkeycov1 != ø, above
...@@ -895,7 +895,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -895,7 +895,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
// vδBroots += δB (δB.Rev could be already there added by ^^^ rebuild) // vδBroots += δB (δB.Rev could be already there added by ^^^ rebuild)
for root := range δB.ByRoot { for root := range δB.ByRoot {
δBtail.vδBroots_Update1(root, δB.Rev) δBtail._vδBroots_Update1(root, δB.Rev)
} }
return δB, err return δB, err
...@@ -979,17 +979,18 @@ func (δBtail *ΔBtail) _Update1(δZ *zodb.EventCommit) (δB1 _ΔBUpdate1, err e ...@@ -979,17 +979,18 @@ func (δBtail *ΔBtail) _Update1(δZ *zodb.EventCommit) (δB1 _ΔBUpdate1, err e
return δB1, nil return δB1, nil
} }
// vδBroots_Update updates .vδBroots to remember that _ΔTtail for root has // _vδBroots_Update updates .vδBroots to remember that _ΔTtail for root has
// changed entries with δrevSet revisions. // changed entries with δrevSet revisions.
func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) { //
// XXX locking // must be called with δBtail.mu locked.
func (δBtail *ΔBtail) _vδBroots_Update(root zodb.Oid, δrevSet setTid) {
// TODO δrevSet -> []rev↑ and merge them in one go // TODO δrevSet -> []rev↑ and merge them in one go
for rev := range δrevSet { for rev := range δrevSet {
δBtail.vδBroots_Update1(root, rev) δBtail._vδBroots_Update1(root, rev)
} }
} }
func (δBtail *ΔBtail) vδBroots_Update1(root zodb.Oid, rev zodb.Tid) { func (δBtail *ΔBtail) _vδBroots_Update1(root zodb.Oid, rev zodb.Tid) {
l := len(δBtail.vδBroots) l := len(δBtail.vδBroots)
j := sort.Search(l, func(k int) bool { j := sort.Search(l, func(k int) bool {
return rev <= δBtail.vδBroots[k].Rev return rev <= δBtail.vδBroots[k].Rev
......
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