Commit 73811795 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e8804bd5
...@@ -664,7 +664,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado ...@@ -664,7 +664,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// head // head
root = headRoot root = headRoot
head = δFtail.Head() head = δFtail.Head()
for zblk, zt := range δFtail.trackSetZBlk { for zblk, zt := range δFtail.trackSetZBlk { // XXX locking
inblk, ok := zt.inroot[root] inblk, ok := zt.inroot[root]
if ok { if ok {
Zinblk[zblk] = inblk.Clone() Zinblk[zblk] = inblk.Clone()
...@@ -847,16 +847,12 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6 ...@@ -847,16 +847,12 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
panicf("zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]", zconnAt, tail, head) panicf("zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]", zconnAt, tail, head)
} }
// XXX locking
// δftail, err := δFtail.rebuild1IfNeeded(foid)
vδE, headRoot, err := δFtail.rebuild1IfNeeded(foid) vδE, headRoot, err := δFtail.rebuild1IfNeeded(foid)
if err != nil { if err != nil {
return zodb.InvalidTid, false, err return zodb.InvalidTid, false, err
} }
// find epoch that covers at and associated blktab root/object // find epoch that covers at and associated blktab root/object
// vδE := δftail.vδE
//fmt.Printf(" vδE: %v\n", vδE) //fmt.Printf(" vδE: %v\n", vδE)
l := len(vδE) l := len(vδE)
i := sort.Search(l, func(i int) bool { i := sort.Search(l, func(i int) bool {
...@@ -868,7 +864,6 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6 ...@@ -868,7 +864,6 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
// root // root
var root zodb.Oid var root zodb.Oid
if i == l { if i == l {
// root = δftail.root
root = headRoot root = headRoot
} else { } else {
root = vδE[i].oldRoot root = vδE[i].oldRoot
...@@ -879,7 +874,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6 ...@@ -879,7 +874,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
i-- i--
if i < 0 { if i < 0 {
// i<0 - first epoch (no explicit start) - use δFtail.tail as lo // i<0 - first epoch (no explicit start) - use δFtail.tail as lo
epoch = δFtail.Tail() epoch = tail
} else { } else {
epoch = vδE[i].Rev epoch = vδE[i].Rev
} }
...@@ -948,9 +943,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6 ...@@ -948,9 +943,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
// ---- vδEBuild (rebuild core) ---- // ---- vδEBuild (rebuild core) ----
// vδEBuild builds vδE from vδZ for file. // vδEBuild builds vδE for file from vδZ.
//
// XXX place ok?
func vδEBuild(foid zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB) (vδE []_ΔFileEpoch, err error) { func vδEBuild(foid zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB) (vδE []_ΔFileEpoch, err error) {
defer xerr.Contextf(&err, "file<%s>: build vδE", foid) defer xerr.Contextf(&err, "file<%s>: build vδE", foid)
......
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