Commit 5dfa6050 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 90f869ab
......@@ -539,7 +539,7 @@ type BigFile struct {
loading map[int64]*blkLoadState // #blk -> {... blkdata}
// XXX mappings where client(s) requested isolation guarantee
//mappings ...
//mappings ... XXX -> watchers?
}
// blkLoadState represents a ZBlk load state/result.
......@@ -614,7 +614,7 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
zwatchq := make(chan zodb.Event)
at0 := root.zstor.AddWatch(zwatchq) // XXX -> to main thread to avoid race
defer root.zstor.DelWatch(zwatchq)
_ = at0 // XXX
_ = at0 // XXX XXX
var zevent zodb.Event
var ok bool
......@@ -626,7 +626,6 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
traceZWatch("cancel")
return ctx.Err()
// TODO handle errors from ZODB watch stream
case zevent, ok = <-zwatchq:
if !ok {
traceZWatch("zwatchq closed")
......@@ -686,6 +685,8 @@ retry:
close(continueOSCacheUpload)
}()
// head.zconnMu locked and not cache uploaders are running
zhead := head.zconn
bfdir := head.bfdir
......@@ -697,18 +698,18 @@ retry:
toinvalidate := map[*BigFile]*fileInvalidate{} // {} file -> set(#blk), sizeChanged
btreeChangev := []zodb.Oid{} // oids changing BTree|Bucket
fmt.Printf("\n\n\n")
//fmt.Printf("\n\n\n")
// zδ = (tid↑, []oid)
for _, oid := range .Changev {
// XXX zhead.Cache() lock/unlock + comment it is not really needed
// XXX zhead.Cache() lock/unlock
obj := zhead.Cache().Get(oid)
if obj == nil {
fmt.Printf("%s: not in cache\n", oid)
//fmt.Printf("%s: not in cache\n", oid)
continue // nothing to do - see invariant
}
fmt.Printf("%s: in cache (%s)\n", oid, typeOf(obj))
//fmt.Printf("%s: in cache (%s)\n", oid, typeOf(obj))
switch obj := obj.(type) {
default:
......@@ -759,9 +760,9 @@ retry:
// find out which files need to be invalidated due to index change
// XXX no indexMu lock needed because head is Locked
// XXX stub -> TODO full δbtree | update indexLooked itself
fmt.Printf("\nbtreeChangev: %v\n", btreeChangev)
//fmt.Printf("\nbtreeChangev: %v\n", btreeChangev)
xfiles := bfdir.indexLooked.Invalidates(btreeChangev)
fmt.Printf("xfiles: %v\n", xfiles)
//fmt.Printf("xfiles: %v\n", xfiles)
for xfile := range xfiles {
file := xfile.(*BigFile)
finv, ok := toinvalidate[file]
......@@ -772,10 +773,10 @@ retry:
finv.size = true
}
fmt.Printf("\n\nzδhandle: toinvalidate (#%d):\n", len(toinvalidate))
for file := range toinvalidate {
fmt.Printf("\t- %s\n", file.zfile.POid())
}
//fmt.Printf("\n\nzδhandle: toinvalidate (#%d):\n", len(toinvalidate))
//for file := range toinvalidate {
// fmt.Printf("\t- %s\n", file.zfile.POid())
//}
wg, ctx := errgroup.WithContext(context.TODO())
for file, finv := range toinvalidate {
......
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