Commit b4137415 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3aff490b
......@@ -257,10 +257,10 @@ package main
// 2) head/bigfile/* of all bigfiles represent state as of zhead.At .
// 3) for head/bigfile/* the following invariant is maintained:
//
// #blk ∈ OS file cache => ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead cache(%)
// (ZBlk* in ghost state)
// #blk ∈ OS file cache => ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead live cache(%)
// (ZBlk* in ghost state)
//
// => all BTree/Bucket that lead to blk are tracked (XXX)
// => all BTree/Bucket that lead to blk are tracked (XXX)
//
// The invariant helps on invalidation: if we see a changed oid, and
// zhead.cache.lookup(oid) = ø -> we know we don't have to invalidate OS
......@@ -848,22 +848,24 @@ retry:
// invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked
δF := bfdir.δFtail.Update(δZ, zhead)
if false {
fmt.Printf("\n\nS: handleδZ: δF (#%d):\n", len(δF.ByFile))
for file, δfile := range δF.ByFile {
blkv := δfile.Blocks.Elements()
sort.Slice(blkv, func(i, j int) bool {
return blkv[i] < blkv[j]
})
size := " "
if δfile.Size {
size = "S"
δF := bfdir.δFtail.Update(δZ, zhead) // δF <- δZ |tracked
if false { // XXX -> V(2) ?
// debug dump δF
fmt.Printf("\n\nS: handleδZ: δF (#%d):\n", len(δF.ByFile))
for file, δfile := range δF.ByFile {
blkv := δfile.Blocks.Elements()
sort.Slice(blkv, func(i, j int) bool {
return blkv[i] < blkv[j]
})
size := " "
if δfile.Size {
size = "S"
}
fmt.Printf("S: \t- %s\t%s %v\n", file.zfile.POid(), size, blkv)
}
fmt.Printf("S: \t- %s\t%s %v\n", file.zfile.POid(), size, blkv)
}
fmt.Printf("\n\n")
fmt.Printf("\n\n")
}
wg := xsync.NewWorkGroup(ctx)
......@@ -876,7 +878,7 @@ retry:
for blk := range δfile.Blocks {
blk := blk
wg.Go(func(ctx context.Context) error {
return file.invalidateBlk(ctx, blk) // XXX +ctx ?
return file.invalidateBlk(ctx, blk)
})
}
}
......@@ -1472,7 +1474,9 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// fmt.Printf("S: read #%d -> pin watchers (#%d)\n", blk, len(f.watchTab))
// update δFtail index
// update δFtail index XXX -> move upper into readBlk ?
// (δFtail is just for δZ -> δF invalidation handling and is needed without isolation protocol)
// XXX ^^^ no - also need to query to send pins
bfdir := f.head.bfdir
bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down?
bfdir.δFtail.Track(f, blk, treepath, zblk) // XXX pass in zblk.rev here?
......
......@@ -459,7 +459,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
//
// it also returns:
//
// - BTree path in .blktab for loaded block,
// - BTree path in .blktab to loaded block,
// - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
// which provides a rough upper-bound estimate for file[blk] revision.
//
......
......@@ -428,6 +428,7 @@ func (δFtail *ΔFtail) SliceByFileRev(file *BigFile, lo, hi zodb.Tid) /*readonl
}
// XXX -> ΔFtail.BlkRevAt (meth of ΔFtail, not file)
// XXX -> BlkRevAt
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
//
......
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