Commit cd78fa30 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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