Commit facc6db8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d0a22768
...@@ -270,7 +270,7 @@ package main ...@@ -270,7 +270,7 @@ package main
// //
// invalidation message: (tid↑, []oid) // invalidation message: (tid↑, []oid)
// //
// 4.1) zhead.cache.lookup(oid) // 4.1) zhead.cache.lookup(oid) XXX -> δFtail
// 4.2) ø: nothing to do - see invariant ^^^. // 4.2) ø: nothing to do - see invariant ^^^.
// 4.3) obj found: // 4.3) obj found:
// //
...@@ -525,7 +525,7 @@ type BigFileDir struct { ...@@ -525,7 +525,7 @@ type BigFileDir struct {
// δ tail of tracked BTree nodes of all BigFiles + -> which file // δ tail of tracked BTree nodes of all BigFiles + -> which file
// (used only for head/, not revX/) // (used only for head/, not revX/)
δFmu sync.RWMutex // XXX zheadMu.W | zheadMu.R + δFmu.X ? δFmu sync.RWMutex // zheadMu.W | zheadMu.R + δFmu.X
δFtail *ΔFtail δFtail *ΔFtail
} }
...@@ -541,7 +541,7 @@ type BigFile struct { ...@@ -541,7 +541,7 @@ type BigFile struct {
zfile *ZBigFile zfile *ZBigFile
// things read/computed from .zfile; constant during lifetime of current transaction. // things read/computed from .zfile; constant during lifetime of current transaction.
// XXX i.e. changed under zhead.W // i.e. changed under zhead.W
blksize int64 // zfile.blksize blksize int64 // zfile.blksize
size int64 // zfile.Size() size int64 // zfile.Size()
rev zodb.Tid // last revision that modified zfile data rev zodb.Tid // last revision that modified zfile data
...@@ -767,13 +767,13 @@ retry: ...@@ -767,13 +767,13 @@ retry:
close(continueOSCacheUpload) close(continueOSCacheUpload)
}() }()
// head.zheadMu locked and all cache uploaders are paused // head.zheadMu wlocked and all cache uploaders are paused
zhead := head.zconn zhead := head.zconn
bfdir := head.bfdir bfdir := head.bfdir
// invalidate kernel cache for data in changed files // invalidate kernel cache for data in changed files
// XXX no δFmu lock needed because head is Locked // NOTE no δFmu lock needed because zhead is WLocked
δF := bfdir.δFtail.Update(δZ, zhead) δF := bfdir.δFtail.Update(δZ, zhead)
if false { if false {
...@@ -843,8 +843,8 @@ retry: ...@@ -843,8 +843,8 @@ retry:
zhead.txnCtx = ctx zhead.txnCtx = ctx
// 2. restat invalidated ZBigFile // 2. restat invalidated ZBigFile
// NOTE no lock needed since .blksize and .size are constant during lifetime of one txn.
// XXX -> parallel // XXX -> parallel
// XXX locking
for file := range δF.ByFile { for file := range δF.ByFile {
size, sizePath, err := file.zfile.Size(ctx) size, sizePath, err := file.zfile.Size(ctx)
if err != nil { if err != nil {
...@@ -854,6 +854,8 @@ retry: ...@@ -854,6 +854,8 @@ retry:
file.size = size file.size = size
bfdir.δFtail.Track(file, -1, sizePath, nil) bfdir.δFtail.Track(file, -1, sizePath, nil)
// XXX we can miss a change to file if δblk is not yet tracked
// -> need to update file.rev at read time -> locking=XXX
file.rev = zhead.At() file.rev = zhead.At()
} }
...@@ -861,7 +863,7 @@ retry: ...@@ -861,7 +863,7 @@ retry:
for sk := range gdebug.zheadSockTab { for sk := range gdebug.zheadSockTab {
_, err := fmt.Fprintf(sk, "%s\n", δZ.Tid) _, err := fmt.Fprintf(sk, "%s\n", δZ.Tid)
if err != nil { if err != nil {
log.Error(err) // XXX errctx, -> warning? log.Errorf("%s", err) // XXX errctx + file, handle, reader pid
sk.Close() sk.Close()
delete(gdebug.zheadSockTab, sk) delete(gdebug.zheadSockTab, sk)
} }
...@@ -2065,7 +2067,7 @@ var gfsconn *nodefs.FileSystemConnector ...@@ -2065,7 +2067,7 @@ var gfsconn *nodefs.FileSystemConnector
// so we still have to reference the root via path. // so we still have to reference the root via path.
var gmntpt string var gmntpt string
// debugging // debugging (protected by zhead.W)
var gdebug = struct { var gdebug = struct {
// .wcfs/zhead opens // .wcfs/zhead opens
// protected by groot.head.zheadMu // protected by groot.head.zheadMu
......
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