Commit 568dbab5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a36307f2
......@@ -303,7 +303,7 @@ func (δFtail *ΔFtail) rebuildAll() (err error) {
for foid := range δFtail.trackNew {
δFtail.trackNew.Del(foid)
δftail := δFtail.byFile[foid]
err := δftail._rebuild1(foid, δZtail, db)
δftail.vδE, err = vδEBuild(foid, δZtail, db)
if err != nil {
return err
}
......@@ -323,17 +323,21 @@ func (δFtail *ΔFtail) rebuild1IfNeeded(foid zodb.Oid) (vδE []_ΔFileEpoch, he
defer δFtail.mu.Unlock()
δftail := δFtail.byFile[foid]
if δftail.vδE != nil {
err = nil
} else {
//
if δftail.vδE == nil {
δFtail.trackNew.Del(foid)
δBtail := δFtail.δBtail
err = δftail._rebuild1(foid, δBtail.ΔZtail(), δBtail.DB())
// XXX indicate rebuild via job
δFtail.mu.Unlock()
// err = δftail._rebuild1(foid, δBtail.ΔZtail(), δBtail.DB())
vδE, err = vδEBuild(foid, δBtail.ΔZtail(), δBtail.DB())
δFtail.mu.Lock()
δftail.vδE = vδE
}
return δftail.vδE, δftail.root, err
return vδE, δftail.root, err
}
/* XXX kill
// _rebuild1 rebuilds vδE.
//
// XXX -> redo to just return built vδE (vδEBuild)
......@@ -354,6 +358,7 @@ func (δftail *_ΔFileTail) _rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *z
δftail.vδE = vδE
return nil
}
*/
// Update updates δFtail given raw ZODB changes.
//
......@@ -676,7 +681,9 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
root = δE.oldRoot
head = δE.Rev - 1 // TODO better set to exact revision coming before δE.Rev
for zblk, inblk := range δE.oldTrackSetZBlk {
Zinblk[zblk] = inblk.Clone()
Zinblk[zblk] = inblk.Clone() // XXX Clone needed ? -> just use oldTrackSetZBlk directly
// XXX -> just use Zinblk = δE.oldTrackSetZBlk directly (without full clone)
// XXX no -> vvv we adjust Zinblk -> thinking
}
}
//fmt.Printf("Zinblk: %v\n", Zinblk)
......
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