Commit 3af1ed43 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9ca80a2a
......@@ -295,7 +295,7 @@ package main
// cache for @<rev>/bigfile/file[blk], where
//
// # see below about file.δtail
// # XXX -> file.δtail.LastBlkRev(#blk, zhead.at)
// # XXX -> file.BlkRevAt(#blk, zhead.at)
// rev = max(file.δtail.by(#blk)) || min(rev ∈ file.δtail) || zhead.at
//
// - invalidate head/bigfile/file[blk] in OS file cache.
......@@ -313,7 +313,7 @@ package main
// 5) after OS file cache was invalidated, we resync zhead to new database
// view corresponding to tid.
//
// 6) for every file δtail invalidation info about head/data is maintained:
// 6) for every file δtail invalidation info about head/data is maintained: XXX -> δFtail
//
// - tailv: [](rev↑, []#blk)
// - by: {} #blk -> []rev↑ in tail
......@@ -341,7 +341,7 @@ package main
// it is not exact because BTree/Bucket can change (e.g. rebalance)
// but still point to the same k->ZBlk.
//
// we also use file.δtail to find either exact blk revision:
// we also use file.δtail to find either exact blk revision: XXX δFtail
//
// rev(blk) = max(file.δtail.by(#blk) -> []rev↑)
//
......@@ -415,14 +415,12 @@ package main
// δF - change in File*s* space
// δfile - change in File(1) space
// XXX describe locking
// XXX locking
//
// head.zheadMu write by handleδZ; read by read
// -> rlockZHead() + lockZHead() ?
// head.zheadMu WLock by handleδZ
// RLock by read
// ...
// XXX locking: test with -race (many bugs are reported)
import (
"bufio"
"context"
......@@ -507,8 +505,6 @@ type Head struct {
// uploadBlk signals to zwatcher that there are so many inflight OS cache uploads currently.
inflightOSCacheUploads int32
// XXX move zconn's current transaction to Head here?
// head/watch opens
// XXX protected by ... zheadMu ?
wlinkTab map[*WatchLink]struct{}
......@@ -545,9 +541,13 @@ type BigFile struct {
zfile *ZBigFile
// things read/computed from .zfile; constant during lifetime of current transaction.
// XXX i.e. changed under zhead.W
blksize int64 // zfile.blksize
size int64 // zfile.Size()
rev zodb.Tid // last revision that modified zfile data
// XXX we can't know rev fully as some later blocks could be learnt only
// while populating δFtail lazily
// XXX or then it is not "constant during lifetime of current txn"
// // tail change history of this file.
// //
......@@ -570,6 +570,7 @@ type BigFile struct {
// progress of being established. XXX text
//
// XXX locking -> watchMu?
// XXX -> watchTab ?
watches map[*Watch]struct{}
}
......@@ -667,6 +668,7 @@ func (_ *zodbCacheControl) PCacheClassify(obj zodb.IPersistent) zodb.PCachePolic
return 0
}
/*
// -------- zhead lock/wait --------
// XXX needed?
......@@ -675,6 +677,7 @@ func (head *Head) zheadRLock() { head.zheadMu.RLock() }
func (head *Head) zheadRUnlock() { head.zheadMu.RUnlock() }
func (head *Head) zheadLock() { head.zheadMu.Lock() }
func (head *Head) zheadUnlock() { head.zheadMu.Unlock() }
*/
// -------- 4) ZODB invalidation -> OS cache --------
......@@ -683,7 +686,7 @@ func traceZWatch(format string, argv ...interface{}) {
return
}
log.Infof("zwatcher: " + format, argv...) // XXX InfoDepthf
log.InfoDepth(1, fmt.Sprintf("zwatcher: " + format, argv...))
}
// zwatcher watches for ZODB changes.
......
......@@ -1785,6 +1785,7 @@ def test_wcfs_watch_2files():
# XXX new watch request while previous watch request is in progress (over the same /head/watch handle)
# XXX @revX/ is automatically removed after some time
......
......@@ -425,6 +425,7 @@ func (δFtail *ΔFtail) SliceByFileRev(file *BigFile, lo, hi zodb.Tid) /*readonl
}
// XXX -> BlkRevAt
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
//
// if exact=False - what is returned is only an upper bound for last block revision.
......
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