Commit f9d2c4e8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4795d8d5
......@@ -141,7 +141,7 @@ type ΔFtail struct {
// mu protects ΔFtail data _and_ all _ΔFileTail/_RootTrack data for all files and roots.
//
// NOTE: even though this lock is global it is used only for brief periouds of time. In
// NOTE: even though this lock is global it is used only for brief periods of time. In
// particular working with retrieved vδE and Zinblk snapshot does not need to hold the lock.
mu sync.Mutex
......@@ -557,7 +557,16 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
rt.ftrackSet.Del(foid)
if len(rt.ftrackSet) == 0 {
delete(δFtail.byRoot, δ.blktabOld)
// XXX reset Zinroot -= δ.blktabNew
// Zinroot -= δ.blktabNew
for zoid := range rt.ztrackInBlk {
inroot, ok := δFtail.ztrackInRoot[zoid]
if ok {
inroot.Del(δ.blktabOld)
if len(inroot) == 0 {
delete(δFtail.ztrackInRoot, zoid)
}
}
}
}
}
}
......@@ -567,7 +576,6 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
rt = &_RootTrack{
ftrackSet: setOid{},
ztrackInBlk: map[zodb.Oid]setI64{},
// XXX reset Zinroot -= δ.blktabNew
}
δFtail.byRoot[δ.blktabNew] = rt
}
......@@ -795,14 +803,12 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
Zinblk.Adj = map[zodb.Oid]setI64{}
for _, δT := range vδT {
for blk, δzblk := range δT.KV {
// XXX VDEL -> whiteout?
if δzblk.Old != xbtree.VDEL {
inblk, ok := Zinblk.Adj[δzblk.Old]
if ok {
inblk.Del(blk)
}
}
// XXX VDEL -> whiteout?
if δzblk.New != xbtree.VDEL {
inblk, ok := Zinblk.Adj[δzblk.New]
if !ok {
......
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