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. ...@@ -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]. // @tail[key] is not present - key was not changing in (tail, head].
// since at ∈ (tail, head] we can use @head[key] as the result // since at ∈ (tail, head] we can use @head[key] as the result
xvalue, ok, err := root.Get(ctx, key) xvalue, ok, err := root.Get(ctx, key)
if !ok {
value = VDEL
}
if err != nil || !ok { if err != nil || !ok {
return return
} }
......
...@@ -262,7 +262,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -262,7 +262,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
delfile = true delfile = true
} }
newEpoch := delfile || (!delfile && delfilePrev && !delfilePrev) // new epoch starts when file is deleted or recreated
newEpoch := delfile || (!delfile && delfile != delfilePrev)
delfilePrev = delfile delfilePrev = delfile
// newEpoch -> reset // newEpoch -> reset
...@@ -328,6 +329,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -328,6 +329,14 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if newEpoch { if newEpoch {
epochv = append(epochv, commit.At) 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 // update blkRevAt
var blkRevPrev map[int64]zodb.Tid var blkRevPrev map[int64]zodb.Tid
...@@ -346,6 +355,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -346,6 +355,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
blkRev[blk] = commit.At blkRev[blk] = commit.At
} }
blkRevAt[commit.At] = blkRev 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 // update zfile
txn.Abort() txn.Abort()
...@@ -363,11 +385,6 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -363,11 +385,6 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf = append(vδf, δfok) 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) //fmt.Printf("Zinblk: %v\n", Zinblk)
// update δFtail // 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