Commit 3cc8369b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6ec94d4d
......@@ -828,6 +828,9 @@ func (δBtail *ΔBtail) GetAt(ctx context.Context, root *Tree, key Key, at zodb.
// @tail[key] is not present - key was not changing in (tail, head].
// since at ∈ (tail, head] we can use @head[key] as the result
xvalue, ok, err := root.Get(ctx, key)
if !ok {
value = VDEL
}
if err != nil || !ok {
return
}
......
......@@ -262,7 +262,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
delfile = true
}
newEpoch := delfile || (!delfile && delfilePrev && !delfilePrev)
// new epoch starts when file is deleted or recreated
newEpoch := delfile || (!delfile && delfile != delfilePrev)
delfilePrev = delfile
// newEpoch -> reset
......@@ -328,6 +329,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if newEpoch {
epochv = append(epochv, commit.At)
}
xat[commit.At] = fmt.Sprintf("at%d", i)
flags := ""
if newEpoch {
flags += "\tEPOCH"
}
t.Logf("# → @%s (%s) δT%s δD%s\t; %s\tδ%s%s", xat[commit.At], commit.At, xbtreetest.KVTxt(test.δblkTab), test.δdataTab, commit.Tree, δblk, flags)
//t.Logf("# vδf: %s", vδfstr(vδf))
// update blkRevAt
var blkRevPrev map[int64]zodb.Tid
......@@ -346,6 +355,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
blkRev[blk] = commit.At
}
blkRevAt[commit.At] = blkRev
if false {
fmt.Printf("blkRevAt[@%s]:\n", xat[commit.At])
blkv := []int64{}
for blk := range blkRev {
blkv = append(blkv, blk)
}
sort.Slice(blkv, func(i, j int) bool {
return blkv[i] < blkv[j]
})
for _, blk := range blkv {
fmt.Printf(" #%d: %v\n", blk, blkRev[blk])
}
}
// update zfile
txn.Abort()
......@@ -363,11 +385,6 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf = append(vδf, δfok)
}
xat[commit.At] = fmt.Sprintf("at%d", i)
// t.Logf("# → @%s (%s) δT%s δD%s\t; %s\tδ%s", xat[commit.At], commit.At, xbtreetest.KVTxt(test.δblkTab), test.δdataTab, tTxt, δblk)
t.Logf("# → @%s (%s) δT%s δD%s\t; %s\tδ%s", xat[commit.At], commit.At, xbtreetest.KVTxt(test.δblkTab), test.δdataTab, commit.Tree, δblk)
//t.Logf("# vδf: %s", vδfstr(vδf))
//fmt.Printf("Zinblk: %v\n", Zinblk)
// update δFtail
......
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