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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
83b604f6
Commit
83b604f6
authored
Apr 05, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a1b94828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
wcfs/wcfs.go
wcfs/wcfs.go
+9
-6
No files found.
wcfs/wcfs.go
View file @
83b604f6
...
...
@@ -932,7 +932,7 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
if
int64
(
len
(
blkdata
))
==
blksize
{
func
()
{
// store retrieved data back to OS cache for file @<rev>/file[blk]
blkrev
,
_
:=
f
.
δtail
.
LastRevOf
(
blk
,
f
.
head
.
zconn
.
At
())
blkrev
,
_
:=
f
.
LastBlkRev
(
blk
,
f
.
head
.
zconn
.
At
())
frev
,
frelease
,
err
:=
groot
.
mkrevfile
(
blkrev
,
f
.
zfile
.
POid
())
if
err
!=
nil
{
log
.
Errorf
(
"BUG: %s: invalidate blk #%d: %s (ignoring, but reading @revX/bigfile will be slow)"
,
f
.
path
(),
blk
,
err
)
...
...
@@ -1159,7 +1159,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
bfdir
.
δFtail
.
Track
(
f
,
treepath
)
bfdir
.
δFmu
.
Unlock
()
blkrevmax
,
_
:=
f
.
δtail
.
LastRevOf
(
blk
,
f
.
zfile
.
PJar
()
.
At
())
// XXX = f.head.zconn.At(
)
blkrevmax
,
_
:=
f
.
LastBlkRev
(
blk
,
f
.
head
.
zconn
.
At
()
)
blkrevmax
=
tidmin
(
blkrevmax
,
pathRevMax
)
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
...
...
@@ -1271,7 +1271,7 @@ func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
// XXX comment
// XXX file.δtail has not full info
rev
,
_
=
w
.
file
.
δtail
.
LastRevOf
(
blk
,
w
.
at
)
rev
,
_
=
w
.
file
.
LastBlkRev
(
blk
,
w
.
at
)
ack
,
err
:=
w
.
link
.
sendReq
(
ctx
,
fmt
.
Sprintf
(
"pin %s #%d @%s"
,
foid
,
blk
,
rev
))
if
err
!=
nil
{
...
...
@@ -1305,7 +1305,8 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// watch was not previously established - set it up anew
// XXX locking
f
:=
wlink
.
head
.
bfdir
.
fileTab
[
foid
]
bfdir
:=
wlink
.
head
.
bfdir
f
:=
bfdir
.
fileTab
[
foid
]
if
f
==
nil
{
// by "invalidation protocol" watch is setup after data file was opened
return
fmt
.
Errorf
(
"file not yet known or is not a ZBigFile"
)
...
...
@@ -1316,13 +1317,14 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// XXX locking
if
at
<
f
.
δ
tail
.
Tail
()
{
if
at
<
bfdir
.
δF
tail
.
Tail
()
{
// XXX err += head.at?
return
fmt
.
Errorf
(
"at is too far away back from head/at"
)
}
toPin
:=
map
[
int64
]
zodb
.
Tid
{}
// blk -> @rev
/* XXX reenable
// XXX f.δtail.Head() not neccessarily = head.At()
// (if f was not changed by a txn, f.δtail stays not updated) XXX correct?
//
...
...
@@ -1338,9 +1340,10 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
}
// FIXME (!!!) again f.δtail can miss some entries
toPin
[
blk
],
_
=
f
.
δtail
.
LastRevOf
(
blk
,
at
)
toPin[blk], _ = f.
LastBlkRev
(blk, at)
}
}
*/
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
for
blk
,
rev
:=
range
toPin
{
...
...
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