Commit b4137415 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3aff490b
...@@ -257,7 +257,7 @@ package main ...@@ -257,7 +257,7 @@ package main
// 2) head/bigfile/* of all bigfiles represent state as of zhead.At . // 2) head/bigfile/* of all bigfiles represent state as of zhead.At .
// 3) for head/bigfile/* the following invariant is maintained: // 3) for head/bigfile/* the following invariant is maintained:
// //
// #blk ∈ OS file cache => ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead cache(%) // #blk ∈ OS file cache => ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead live cache(%)
// (ZBlk* in ghost state) // (ZBlk* in ghost state)
// //
// => all BTree/Bucket that lead to blk are tracked (XXX) // => all BTree/Bucket that lead to blk are tracked (XXX)
...@@ -848,9 +848,11 @@ retry: ...@@ -848,9 +848,11 @@ retry:
// invalidate kernel cache for data in changed files // invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked // NOTE no δFmu lock needed because zhead is WLocked
δF := bfdir.δFtail.Update(δZ, zhead)
if false { δ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)) fmt.Printf("\n\nS: handleδZ: δF (#%d):\n", len(δF.ByFile))
for file, δfile := range δF.ByFile { for file, δfile := range δF.ByFile {
blkv := δfile.Blocks.Elements() blkv := δfile.Blocks.Elements()
...@@ -876,7 +878,7 @@ retry: ...@@ -876,7 +878,7 @@ retry:
for blk := range δfile.Blocks { for blk := range δfile.Blocks {
blk := blk blk := blk
wg.Go(func(ctx context.Context) error { 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 ...@@ -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)) // 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 := f.head.bfdir
bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down? bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down?
bfdir.δFtail.Track(f, blk, treepath, zblk) // XXX pass in zblk.rev here? 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) { ...@@ -459,7 +459,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
// //
// it also returns: // 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) // - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
// which provides a rough upper-bound estimate for file[blk] revision. // 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 ...@@ -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 // XXX -> BlkRevAt
// LastBlkRev returns last revision that changed file[blk] as of @at database state. // 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