Commit cd78fa30 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 912fa765
......@@ -177,7 +177,7 @@ type ΔBtail struct {
trackNew SetOid
// tracked nodes index: node -> parent + keys tracked under this node
// tracked nodes index: node -> parent + accessed holes under this node
trackIdx map[zodb.Oid]nodeTrack
}
......@@ -185,8 +185,7 @@ type ΔBtail struct {
// nodeTrack represents tracking information about a node.
type nodeTrack struct {
parent zodb.Oid // parent node | InvalidOid for root
holes SetKey // missing keys tracked under this node XXX nil for root(?) XXX only !empty root
// trackedKeys SetKey // XXX kill
holes SetKey // missing keys tracked under this node; nil for !leaf
}
// ΔB represents a change in BTrees space.
......@@ -295,12 +294,15 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags Track
parent := zodb.InvalidOid
var track nodeTrack
var oldTrack bool
for _, node := range path {
for i, node := range path {
oid := node.POid()
// XXX check for InvalidOid (e.g. T/B1:a with bucket not having its own oid.
track, oldTrack = δBtail.trackIdx[oid]
if !oldTrack {
track = nodeTrack{parent: parent, holes: SetKey{}}
track = nodeTrack{parent: parent}
if i == l-1 { // leaf
track.holes = SetKey{}
}
δBtail.trackIdx[oid] = track
// XXX .trackNew += oid
}
......
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