Commit 66c5b4d4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0d366d6e
...@@ -878,12 +878,10 @@ def test_wcfs(): ...@@ -878,12 +878,10 @@ def test_wcfs():
# >>> (@at3) commit again without changing zf size XXX write about b cache inval # >>> (@at3) commit again without changing zf size XXX write about b cache inval
f2 = t.open(zf, at=at2) f2 = t.open(zf, at=at2)
# t.change(zf, {2: '3c'}) t.change(zf, {2: '3c'}) # FIXME + 3b after δbtree works (hole -> zblk)
t.change(zf, {1: '3b', 2: '3c'})
at3 = t.commit() at3 = t.commit()
# f.assertCache([1,1,0,1]) # XXX b must be uncached f.assertCache([1,1,0,1]) # FIXME b must be invalidated (see 3b ^^^)
f.assertCache([1,0,0,1])
# f @head is opened again -> cache must not be lost # f @head is opened again -> cache must not be lost
f_ = t.open(zf) f_ = t.open(zf)
......
...@@ -129,7 +129,6 @@ type ΔTtail struct { ...@@ -129,7 +129,6 @@ type ΔTtail struct {
// ΔTree describes changes to one BTree in one revision. // ΔTree describes changes to one BTree in one revision.
type ΔTree struct { type ΔTree struct {
Rev zodb.Tid Rev zodb.Tid
// Root *Tree // XXX ok to have here?
KV map[Key]Value KV map[Key]Value
} }
...@@ -162,7 +161,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() } ...@@ -162,7 +161,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// Track adds tree path to tracked set. // Track adds tree path to tracked set.
// //
// path[0] signifies a root. // path[0] signifies tree root.
// All path elemens must be Tree except last one which must be Bucket. // All path elemens must be Tree except last one which must be Bucket.
// //
// XXX δBtail is rebuild to also include keys corresponding to added nodes. // XXX δBtail is rebuild to also include keys corresponding to added nodes.
...@@ -211,13 +210,13 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) ΔB { ...@@ -211,13 +210,13 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) ΔB {
// {} root -> []oid changed under that root in tracked set // {} root -> []oid changed under that root in tracked set
δZByRoot := map[*Tree][]zodb.Oid{} // XXX -> map[*Tree]SetOid ? δZByRoot := map[*Tree][]zodb.Oid{} // XXX -> map[*Tree]SetOid ?
for _, δ := range δZ.Changev { for _, oid := range δZ.Changev {
roots, ok := δBtail.trackIdx[δ] roots, ok := δBtail.trackIdx[oid]
if !ok { if !ok {
continue continue
} }
for root := range roots { for root := range roots {
δZByRoot[root] = append(δZByRoot[root], δ) δZByRoot[root] = append(δZByRoot[root], 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