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