Commit aaca62ff authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent edddfbe7
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
// (*) see "Wcfs locking organization" in wcfs.go // (*) see "Wcfs locking organization" in wcfs.go
// (%) see related comment in Conn.__pin1 for details. // (%) see related comment in Conn.__pin1 for details.
// Handling of fork // Handling of fork
// //
// When a process calls fork, OS copies its memory and creates child process // When a process calls fork, OS copies its memory and creates child process
......
...@@ -160,7 +160,7 @@ cdef extern from "<fcntl.h>" nogil: ...@@ -160,7 +160,7 @@ cdef extern from "<fcntl.h>" nogil:
int posix_fadvise(int fd, off_t offset, off_t len, int advice); int posix_fadvise(int fd, off_t offset, off_t len, int advice);
enum: POSIX_FADV_DONTNEED enum: POSIX_FADV_DONTNEED
# fadvise_dontneed teels the kernel that file<fd>[offset +len) is not needed. # fadvise_dontneed tells the kernel that file<fd>[offset +len) is not needed.
# #
# see fadvise(2) for details. # see fadvise(2) for details.
def fadvise_dontneed(int fd, off_t offset, off_t len): def fadvise_dontneed(int fd, off_t offset, off_t len):
......
...@@ -602,7 +602,8 @@ type BigFileDir struct { ...@@ -602,7 +602,8 @@ 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 // zheadMu.W | zheadMu.R + δFmu.X XXX kill δFmu // XXX read/write access protected by zheadMu
// δFmu sync.RWMutex // zheadMu.W | zheadMu.R + δFmu.X XXX kill δFmu
δFtail *zdata.ΔFtail δFtail *zdata.ΔFtail
} }
...@@ -1533,10 +1534,10 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr ...@@ -1533,10 +1534,10 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// see "3) for */head/data the following invariant is maintained..." // see "3) for */head/data the following invariant is maintained..."
bfdir := f.head.bfdir bfdir := f.head.bfdir
δFtail := bfdir.δFtail δFtail := bfdir.δFtail
bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down? // bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down?
δFtail.Track(f.zfile, blk, treepath, blkcov, zblk) // XXX pass in zblk.rev here? δFtail.Track(f.zfile, blk, treepath, blkcov, zblk) // XXX pass in zblk.rev here?
f.accessed.Add(blk) f.accessed.Add(blk)
bfdir.δFmu.Unlock() // bfdir.δFmu.Unlock()
// make sure that file[blk] on clients side stays as of @w.at state. // make sure that file[blk] on clients side stays as of @w.at state.
...@@ -1634,7 +1635,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1634,7 +1635,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
defer head.zheadMu.RUnlock() defer head.zheadMu.RUnlock()
headAt := head.zconn.At() headAt := head.zconn.At()
// XXX δFtail locking? (or ForgetPast is called only with zheadMu.W ?) // // XXX δFtail locking? (or ForgetPast is called only with zheadMu.W ? - yes)
if at != zodb.InvalidTid && at < bfdir.δFtail.Tail() { if at != zodb.InvalidTid && at < bfdir.δFtail.Tail() {
return fmt.Errorf("too far away back from head/at (@%s); δt = %s", return fmt.Errorf("too far away back from head/at (@%s); δt = %s",
headAt, headAt.Time().Sub(at.Time().Time)) headAt, headAt.Time().Sub(at.Time().Time))
...@@ -2264,9 +2265,9 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er ...@@ -2264,9 +2265,9 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
// only head/ needs δFtail, f.δtail and watches. // only head/ needs δFtail, f.δtail and watches.
if head.rev == 0 { if head.rev == 0 {
// see "3) for */head/data the following invariant is maintained..." // see "3) for */head/data the following invariant is maintained..."
head.bfdir.δFmu.Lock() // XXX locking ok? // head.bfdir.δFmu.Lock() // XXX locking ok?
head.bfdir.δFtail.Track(f.zfile, -1, sizePath, blkCov, nil) head.bfdir.δFtail.Track(f.zfile, -1, sizePath, blkCov, nil)
head.bfdir.δFmu.Unlock() // head.bfdir.δFmu.Unlock()
// FIXME: scan zfile.blktab - so that we can detect all btree changes // FIXME: scan zfile.blktab - so that we can detect all btree changes
// see "XXX building δFtail lazily ..." in notes.txt // see "XXX building δFtail lazily ..." in notes.txt
......
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