Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
5dfa6050
Commit
5dfa6050
authored
Mar 20, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
90f869ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
wcfs/wcfs.go
wcfs/wcfs.go
+14
-13
No files found.
wcfs/wcfs.go
View file @
5dfa6050
...
...
@@ -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
zδ
.
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
(
"
\n
btreeChangev: %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\n
zδ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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment