Commit eae0f211 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 735149be
......@@ -813,7 +813,7 @@ retry:
// find out which files need to be invalidated due to index change
// XXX no indexMu lock needed because head is Locked
//fmt.Printf("\nbtreeChangev: %v\n", btreeChangev)
δF := bfdir.δFtail.Update(δZ)
δF := bfdir.δFtail.Update(δZ, zhead)
//fmt.Printf("xfiles: %v\n", xfiles)
for file, δfile := range δF.Change {
finv, ok := toinvalidate[file]
......
......@@ -162,7 +162,11 @@ func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zbl
// It returns change in files space that corresponds to δZ.
//
// δZ should include all objects changed by ZODB transaction.
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
//
// Zhead must be active connection at δFtail.Head() database state.
// Objects in Zhead must not be modified.
// During call to Update zhead must not be otherwise used - even for reading.
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) ΔF {
δB := δFtail.δBtail.Update(δZ)
δF := ΔF{Rev: δB.Rev, Change: make(map[*BigFile]SetI64)}
......@@ -189,8 +193,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
// take zblk changes into account
for _, oid := range δZ.Changev {
// XXX cache lock/unlock
var zcache *zodb.LiveCache // XXX stub
obj := zcache.Get(oid)
obj := zhead.Cache().Get(oid)
if obj == nil {
//fmt.Printf("%s: not in cache\n", oid)
continue // nothing to do - see invariant
......@@ -199,9 +202,6 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
//fmt.Printf("%s: in cache (%s)\n", oid, typeOf(obj))
switch obj := obj.(type) {
default:
continue // object not related to any bigfile
case zBlk: // ZBlk*
// z.infile locking: since we write-locked head.zconnMu
// - no other fuse reads are running, and thus no one
......@@ -217,6 +217,8 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
δfile.Update(blocks)
}
// XXX update z.infile according to btree changes
case *ZBigFile:
// XXX check that .blksize and .blktab (it is only
// persistent reference) do not change.
......
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