Commit c4ea2ec6 authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: hook in δFtail.Forget

parent ad8ff46a
......@@ -308,6 +308,9 @@ package main
// 4.4) processing ZODB invalidations and serving file reads (see 7) are
// organized to be mutually exclusive.
//
// 5.5) similarly, processing ZODB invalidations and setting up watches (see
// 7.2) are organized to be mutually exclusive.
//
// 5) after OS file cache was invalidated, we resync zhead to new database
// view corresponding to tid.
//
......@@ -481,7 +484,7 @@ import (
"sync"
"sync/atomic"
"syscall"
// "time"
"time"
log "github.com/golang/glog"
......@@ -952,7 +955,19 @@ retry:
}
}
// XXX δFtail.ForgetPast(...)
// shrink δFtail not to grow indefinitely.
// cover history for at least 1 minute, but including all watches.
// No need to lock anything because we are holding zheadMu and
// setupWatch too runs with zheadMu locked.
revCut := zodb.TidFromTime(zhead.At().Time().Add(-1*time.Minute))
for wlink := range head.wlinkTab {
for _, w := range wlink.byfile {
if w.at < revCut {
revCut = w.at
}
}
}
bfdir.δFtail.ForgetPast(revCut)
// notify zhead.At waiters
for hw := range head.hwait {
......
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