Commit ba09bb73 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c5969bd9
...@@ -288,16 +288,9 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat ...@@ -288,16 +288,9 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
if l == 0 { if l == 0 {
panic("empty path") panic("empty path")
} }
treeRoot := path[0].(*Tree)
/*
var leafBucket *Bucket
if l := len(path); l > 1 {
leafBucket = path[l-1].(*Bucket)
}
*/
// XXX assert Tree Tree ... Tree Bucket // XXX assert Tree Tree ... Tree Bucket
root := treeRoot.POid() root := path[0].(*Tree).POid()
pathv := []string{} pathv := []string{}
for _, node := range path { pathv = append(pathv, vnode(node)) } for _, node := range path { pathv = append(pathv, vnode(node)) }
...@@ -326,58 +319,8 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat ...@@ -326,58 +319,8 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
// remember missing keys in track of leaf node (bucket or top-level ø tree) // remember missing keys in track of leaf node (bucket or top-level ø tree)
if !keyPresent { if !keyPresent {
track.holes.Add(key) track.holes.Add(key)
/*
if leafBucket != nil {
track.holes.Add(key)
} else {
// empty tree
rootTrack := δBtail.trackIdx[root] // must succeed
rootTrack.holes.Add(key)
}
*/
} }
/* XXX kill
// tracked += all keys of leaf bucket for every node up to the root
fmt.Printf(" oldTrack: %v leafBucket: %v\n", oldTrack, leafBucket)
if !oldTrack && leafBucket != nil {
// activate leaf node to get access to its data
if leafBucket.POid() != zodb.InvalidOid {
// normal bucket
err := leafBucket.PActivate(ctx)
if err != nil {
return err
}
defer leafBucket.PDeactivate()
} else {
// bucket embedded into tree
// XXX assert len(path) == 2
err := treeRoot.PActivate(ctx)
if err != nil {
return err
}
defer treeRoot.PDeactivate()
// XXX assert len(treeRoot.Entryv()) == 1
// XXX assert [0] is Bucket && POid == zodb.InvalidOid
leafBucket = treeRoot.Entryv()[0].Child().(*Bucket) // because it is recreated
}
bkeys := SetKey{}
for _, __ := range leafBucket.Entryv() {
bkeys.Add(__.Key())
}
fmt.Printf(" bkeys: %s\n", bkeys)
for {
track.trackedKeys.Update(bkeys)
if track.parent == zodb.InvalidOid {
break
}
track = δBtail.trackIdx[track.parent]
}
}
*/
_, ok := δBtail.byRoot[root] _, ok := δBtail.byRoot[root]
if !ok { if !ok {
......
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