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
136a3313
Commit
136a3313
authored
Apr 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
125b2a0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
wcfs/wcfs.go
wcfs/wcfs.go
+10
-3
No files found.
wcfs/wcfs.go
View file @
136a3313
...
...
@@ -1353,25 +1353,32 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
return
fmt
.
Errorf
(
"file not yet known or is not a ZBigFile"
)
}
headAt
:=
head
.
zconn
.
At
()
// XXX wait head.zconn.At() ≥ at
// XXX <~> f.δtail.Head() ≥ at (?)
if
at
<
bfdir
.
δFtail
.
Tail
()
{
// XXX err += head.at?
return
fmt
.
Errorf
(
"at is too far away back from head/at"
)
return
fmt
.
Errorf
(
"at is too far away back from head/at (%s)"
,
headAt
)
}
// TODO register w to f here early, so that READs going in parallel to us
// preparing and processing initial pins, also sends pin for read
// blocks. If we don't we can miss to send pin for a freshly read which
// could have revision > w.at .
w
=
&
Watch
{
link
:
wlink
,
file
:
f
,
at
:
at
,
pinned
:
make
(
SetI64
),
}
toPin
:=
map
[
int64
]
zodb
.
Tid
{}
// blk -> @rev
// XXX locking
// pin all tracked file blocks that were changed (at, head] range
fhead
:=
tidmin
(
f
.
δtail
.
Head
(),
head
.
zconn
.
At
()
)
fhead
:=
tidmin
(
f
.
δtail
.
Head
(),
head
At
)
for
_
,
δfile
:=
range
f
.
δtail
.
SliceByRev
(
at
,
fhead
)
{
for
_
,
blk
:=
range
δfile
.
Changev
{
_
,
already
:=
toPin
[
blk
]
...
...
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