Commit a3af5a18 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a7adc935
...@@ -750,6 +750,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) { ...@@ -750,6 +750,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
} }
func (δTtail *ΔTtail) forgetPast(revCut zodb.Tid) { func (δTtail *ΔTtail) forgetPast(revCut zodb.Tid) {
// XXX locking
// XXX lastRevOf // XXX lastRevOf
icut := 0 icut := 0
......
...@@ -192,6 +192,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -192,6 +192,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
zroot.PDeactivate() zroot.PDeactivate()
foid := zfile.POid() foid := zfile.POid()
err = zfile.PActivate(ctx); X(err) err = zfile.PActivate(ctx); X(err)
blksize := zfile.blksize
blktabOid := zfile.blktab.POid() blktabOid := zfile.blktab.POid()
if blktabOid != t.Root() { if blktabOid != t.Root() {
t.Fatalf("BUG: zfile.blktab (%s) != treeroot (%s)", blktabOid, t.Root()) t.Fatalf("BUG: zfile.blktab (%s) != treeroot (%s)", blktabOid, t.Root())
...@@ -201,6 +202,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -201,6 +202,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
// data built via applying changes from testv // data built via applying changes from testv
vδf := []*ΔFile{} // (rev↑, {}blk) vδf := []*ΔFile{} // (rev↑, {}blk)
//vδE := []_ΔFileEpoch{} // (rev↑, EPOCH)
var vδE []_ΔFileEpoch // FIXME change to !nil (^^^) after ΔFtail.rebuild is added
blkTab := map[int64]string{} // #blk -> ZBlk<name> blkTab := map[int64]string{} // #blk -> ZBlk<name>
dataTab := map[string]string{} // ZBlk<name> -> data dataTab := map[string]string{} // ZBlk<name> -> data
Zinblk := map[string]setI64{} // ZBlk<name> -> which #blk refer to it Zinblk := map[string]setI64{} // ZBlk<name> -> which #blk refer to it
...@@ -387,6 +390,21 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -387,6 +390,21 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
} }
vδf = append(vδf, δfok) vδf = append(vδf, δfok)
} }
if newEpoch {
δE := _ΔFileEpoch{Rev: commit.At}
if delfile {
δE.oldRoot = blktabOid
δE.newRoot = zodb.InvalidOid
δE.newBlkSize = -1
// XXX oldBlkSize ?
} else {
δE.oldRoot = zodb.InvalidOid
δE.newRoot = blktabOid
δE.newBlkSize = blksize
// XXX oldBlkSize ?
}
vδE = append(vδE, δE)
}
//fmt.Printf("Zinblk: %v\n", Zinblk) //fmt.Printf("Zinblk: %v\n", Zinblk)
...@@ -452,19 +470,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -452,19 +470,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf = vδf[1:] vδf = vδf[1:]
//t.Logf("# vδf: %s", vδfstr(vδf)) //t.Logf("# vδf: %s", vδfstr(vδf))
//t.Logf("# vδt: %s", vδfstr(δFtail.SliceByFileRev(zfile, δFtail.Tail(), δFtail.Head()))) //t.Logf("# vδt: %s", vδfstr(δFtail.SliceByFileRev(zfile, δFtail.Tail(), δFtail.Head())))
icut := 0;
for ; icut < len(vδE); icut++ {
if vδE[icut].Rev > revcut {
break
}
}
vδE = vδE[icut:]
} }
// verify vδE // verify vδE
//vδEok := []_ΔFileEpoch{}
var vδEok []_ΔFileEpoch // FIXME change to !nil (^^^) after ΔFtail.rebuild is added
for _, δf := range vδf {
if δf.Epoch {
vδEok = append(vδEok, _ΔFileEpoch{Rev: δf.Rev}) // XXX + root,size
}
}
δftail := δFtail.byFile[foid] δftail := δFtail.byFile[foid]
if !reflect.DeepEqual(δftail.vδE, vδEok) { if !reflect.DeepEqual(δftail.vδE, vδE) {
t.Errorf("vδE:\nhave: %v\nwant: %v", δftail.vδE, vδEok) t.Errorf("vδE:\nhave: %v\nwant: %v", δftail.vδE, vδE)
} }
......
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