Commit 16571605 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 37934304
...@@ -281,19 +281,16 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) { ...@@ -281,19 +281,16 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
} }
// take zblk changes into account // take zblk changes into account
δzfile := map[zodb.Oid]*_ΔZBigFile{} // which tracked ZBigFiles are changed
for _, oid := range δZ.Changev { for _, oid := range δZ.Changev {
if δFtail.trackSetZFile.Has(oid) { if δFtail.trackSetZFile.Has(oid) {
// TODO check that .blksize and .blktab (it is only
// persistent reference) do not change. XXX -> EPOCH
δ, err := zfilediff(δFtail.δBtail.DB(), oid, headOld, δZ.Tid) δ, err := zfilediff(δFtail.δBtail.DB(), oid, headOld, δZ.Tid)
if err != nil { if err != nil {
return ΔF{}, err return ΔF{}, err
} }
if δ != nil { if δ != nil {
fmt.Printf("δZBigFile: %v\n", δ) δzfile[oid] = δ
return ΔF{}, fmt.Errorf("ZBigFile<%s> changed @%s", oid, δZ.Tid)
} }
continue continue
...@@ -322,6 +319,22 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) { ...@@ -322,6 +319,22 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
} }
} }
// if ZBigFile object is changed - it starts new epoch for that file
for foid, δ := range δzfile {
δfile, ok := δF.ByFile[foid]
if !ok {
δfile = &ΔFile{Rev: δF.Rev}
δF.ByFile[foid] = δfile
}
δfile.Epoch = true
δfile.Blocks = nil
δfile.Size = false
_ = δ
//fmt.Printf("δZBigFile: %v\n", δ)
//return ΔF{}, fmt.Errorf("ZBigFile<%s> changed @%s", oid, δZ.Tid)
}
// fmt.Printf("-> δF: %v\n", δF) // fmt.Printf("-> δF: %v\n", δF)
return δF, nil return δF, nil
} }
......
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