Commit b0b62edc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c051c89b
...@@ -78,7 +78,6 @@ package xbtree ...@@ -78,7 +78,6 @@ package xbtree
// (*) implemented in treediff.go // (*) implemented in treediff.go
// (+) full database scan // (+) full database scan
////go:generate ./blib/gen-rangemap _RangedMap_Path []zodbOid zrangemap_path.go
//go:generate ./blib/gen-rangemap _RangedMap_RebuildJob *_RebuildJob zrangemap_rebuildjob.go //go:generate ./blib/gen-rangemap _RangedMap_RebuildJob *_RebuildJob zrangemap_rebuildjob.go
import ( import (
...@@ -96,7 +95,6 @@ import ( ...@@ -96,7 +95,6 @@ import (
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xtail" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xtail"
) )
//type zodbOid = zodb.Oid XXX kill
const traceΔBtail = false const traceΔBtail = false
const debugΔBtail = false const debugΔBtail = false
...@@ -173,15 +171,11 @@ type _ΔTtail struct { ...@@ -173,15 +171,11 @@ type _ΔTtail struct {
// want to change data that is already returned to user. // want to change data that is already returned to user.
vδT []ΔTree // changes to tree keys; rev↑. covers keys ∈ tracked subset vδT []ΔTree // changes to tree keys; rev↑. covers keys ∈ tracked subset
// // set of keys(nodes) that were requested to be tracked in this tree,
// // but for which vδT rebuild was not yet started
// ktrackNew _RangedMap_Path // {} keycov -> path
// set of keys that were requested to be tracked in this tree, // set of keys that were requested to be tracked in this tree,
// but for which vδT rebuild was not yet started // but for which vδT rebuild was not yet started
ktrackNew blib.RangedKeySet // {keycov} ktrackNew blib.RangedKeySet // {keycov}
// set of nodes corresponding to ktrackNew // set of nodes corresponding to ktrackNew
trackNew blib.PPTreeSubSet trackNew blib.PPTreeSubSet // PP{nodes}
// set of keys(nodes) for which rebuild is in progress // set of keys(nodes) for which rebuild is in progress
krebuildJobs _RangedMap_RebuildJob // {} keycov -> job krebuildJobs _RangedMap_RebuildJob // {} keycov -> job
...@@ -574,6 +568,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er ...@@ -574,6 +568,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
} }
// rebuild1 rebuilds ΔBtail for single root. // rebuild1 rebuilds ΔBtail for single root.
// XXX inline into rebuildAll ?
func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error { func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
// XXX locking // XXX locking
δTtail := δBtail.byRoot[root] // must be there δTtail := δBtail.byRoot[root] // must be there
...@@ -930,7 +925,7 @@ func (δBtail *ΔBtail) _Update1(δZ *zodb.EventCommit) (δB1 _ΔBUpdate1, err e ...@@ -930,7 +925,7 @@ func (δBtail *ΔBtail) _Update1(δZ *zodb.EventCommit) (δB1 _ΔBUpdate1, err e
δBtail.δZtail.Append(δZ.Tid, δZ.Changev) δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
// NOTE: keep vvv in sync with ΔTtail.rebuild1 // NOTE: keep vvv in sync with vδTRebuild1
δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackSet) δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackSet)
...@@ -1110,7 +1105,7 @@ func (δBtail *ΔBtail) GetAt(root zodb.Oid, key Key, at zodb.Tid) (value Value, ...@@ -1110,7 +1105,7 @@ func (δBtail *ΔBtail) GetAt(root zodb.Oid, key Key, at zodb.Tid) (value Value,
rev = tail rev = tail
revExact = false revExact = false
// retrieve vδT snapshot that is rebuilt to take Track(key) requests // retrieve vδT snapshot that is rebuilt to take Track(key) requests into account
vδT, err := δBtail.vδTSnapForTrackedKey(root, key) vδT, err := δBtail.vδTSnapForTrackedKey(root, key)
if err != nil { if err != nil {
return value, rev, valueExact, revExact, err return value, rev, valueExact, revExact, err
...@@ -1162,7 +1157,7 @@ func (δBtail *ΔBtail) SliceByRootRev(root zodb.Oid, lo, hi zodb.Tid) (/*readon ...@@ -1162,7 +1157,7 @@ func (δBtail *ΔBtail) SliceByRootRev(root zodb.Oid, lo, hi zodb.Tid) (/*readon
}() }()
} }
// retrieve vδT snapshot that is rebuilt to take all previous Track requests // retrieve vδT snapshot that is rebuilt to take all previous Track requests into account
vδT, err := δBtail.vδTSnapForTracked(root) vδT, err := δBtail.vδTSnapForTracked(root)
if err != nil { if err != nil {
panic(err) // XXX panic(err) // XXX
......
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