Commit fc5deb55 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4f6d5caf
......@@ -116,6 +116,9 @@ type ΔBtail struct {
// tracked objects that are not yet taken into account in current δBtail
trackNew SetOid
// tracked keys that are not in current version of the tree.
tkdel SetKey
}
// ΔB represents a change in BTrees space.
......@@ -203,7 +206,7 @@ const (
// XXX TrackMinKey (we don't need it in WCFS)
)
func (δBtail *ΔBtail) Track(path []Node, flags TrackFlags) { // XXX Tree|Bucket; path[0] = root
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags TrackFlags) { // XXX Tree|Bucket; path[0] = root
l := len(path)
if l == 0 {
panic("empty path")
......@@ -244,6 +247,8 @@ func (δBtail *ΔBtail) Track(path []Node, flags TrackFlags) { // XXX Tree|Bucke
// only those keys, that correspond to tracked subset of δZ.
//
// δZ should include all objects changed by ZODB transaction.
//
// XXX optionally accept zconnOld/zconnNew from client
func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
headOld := δBtail.Head()
defer xerr.Contextf(&err, "ΔBtail update %s -> %s", headOld, δZ.Tid)
......
......@@ -529,7 +529,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
kadjTracked = SetKey{} // kadj[Tracked] (all keys adjacent to tracked keys)
for k := range initialTrackedKeys {
path := []Node{}
_, _, err = ztree.VGet(ctx, k, func(node Node) {
_, ok, err := ztree.VGet(ctx, k, func(node Node) {
path = append(path, node)
}); X(err)
......@@ -538,7 +538,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
if k == kInf {
trackFlags = TrackMaxKey
}
δbtail.Track(path, trackFlags)
δbtail.Track(k, ok, path, trackFlags)
kadjTracked.Update(kadj[k])
}
......
......@@ -139,9 +139,10 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zblk zBlk) {
δbTrackFlags := TrackFlags(0)
if blk == -1 {
// XXX blk = ∞ ?
δbTrackFlags = TrackMaxKey
}
δFtail.δBtail.Track(path, δbTrackFlags)
δFtail.δBtail.Track(blk, zblk != nil, path, δbTrackFlags)
root := path[0].(*btree.LOBTree)
files, ok := δFtail.fileIdx[root.POid()]
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