Commit f21771d3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a7e3e8f6
......@@ -622,7 +622,7 @@ type Watch struct {
link *WatchLink // link to client
file *BigFile // XXX needed?
mu sync.Mutex // XXX ok ?
mu sync.Mutex // XXX split -> atMu(RW) + pinnedMu
at zodb.Tid // requested to be watched @at
pinned map[int64]*blkPinState // {} blk -> {... rev} blocks that are already pinned to be ≤ at
}
......@@ -1298,7 +1298,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
w.mu.Lock()
// XXX ignore vvv ? (w.at could be ↑ after precheck in read (XXX or setupBlk)
// XXX ignore vvv ? (w.at could be ↑ after precheck in read (XXX or setupWatch)
if wat := w.at; !(rev == zodb.TidMax || rev <= wat) {
w.mu.Unlock()
panicf("f<%s>: wlink%d: pin #%d @%s: watch.at (%s) < rev",
......@@ -1383,7 +1383,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
//
// XXX do we really need to use/propagate caller context here? ideally update
// watchers should be synchronous, and in practice we just use 30s timeout.
// Should a READ interrupt cause watch update failure?
// Should a READ interrupt cause watch update failure? -> probably no
func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btree.LONode, zblk zBlk, blkrevMax zodb.Tid) {
// only head/ is being watched for
if f.head.rev != 0 {
......@@ -1418,7 +1418,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// XXX locking (w)
// the block is already covered by @w.at database view
if blkrev <= w.at {
if blkrev <= w.at { // XXX locking
continue
}
......@@ -1429,7 +1429,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
blkrevRough = false
// XXX w.at could be only ↑ ? if not - locking is more complex
if blkrev <= w.at {
if blkrev <= w.at { // XXX locking
continue
}
}
......@@ -1440,7 +1440,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// and most of them would be on different w.at - cache of the file will
// be lost. Via pinning to particular block revision, we make sure the
// revision to pin is the same on all clients, and so file cache is shared.
pinrev, _ := w.file.LastBlkRev(ctx, blk, w.at) // XXX move into go?
pinrev, _ := w.file.LastBlkRev(ctx, blk, w.at) // XXX locking (w), move into go?
wg.Go(func() error {
// XXX close watcher on any error
......
......@@ -60,7 +60,7 @@ def setup_module():
install_sigbus_trap()
# if wcfs.go is built with race detector and detects a race - make it fail
# current test loudly on the first wcfs.go race
# current test loudly on the first wcfs.go race.
gorace = os.environ.get("GORACE", "")
if gorace != "":
gorace += " "
......
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