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
6ce6b134
Commit
6ce6b134
authored
Apr 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5d838496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
wcfs/wcfs.go
wcfs/wcfs.go
+20
-16
No files found.
wcfs/wcfs.go
View file @
6ce6b134
...
...
@@ -281,7 +281,7 @@ package main
// FIXME no - we can build it but not in full - since we consider only zobj in live cache.
// FIXME and even if we consider all δ'ed zobj, building complete set of
// file.δtail requires to first do complete scan of file.blktab
// which is prohibitively expensive.
// which is prohibitively expensive.
XXX -> no, we'll do the scan
//
// 4.4) for all file/blk to invalidate we do:
//
...
...
@@ -537,8 +537,11 @@ type BigFile struct {
size
int64
// zfile.Size()
rev
zodb
.
Tid
// last revision that modified zfile data
// // tail change history of this file.
// δtail *ΔTailI64 // [](rev↑, []#blk) XXX kill
// tail change history of this file.
//
// XXX computationally expensive to start - see "Invalidations to wcfs
// clients are delayed ..." in notes.txt
δtail
*
ΔTailI64
// [](rev↑, []#blk)
// inflight loadings of ZBigFile from ZODB.
// successful load results are kept here until blkdata is put into OS pagecache.
...
...
@@ -812,14 +815,15 @@ retry:
δF
:=
bfdir
.
δFtail
.
Update
(
δZ
)
//fmt.Printf("xfiles: %v\n", xfiles)
for
file
,
δfile
:=
range
δF
.
Change
{
// XXX use δfile blocks
_
=
δfile
finv
,
ok
:=
toinvalidate
[
file
]
if
!
ok
{
finv
=
&
fileInvalidate
{}
// XXX init blkmap?
toinvalidate
[
file
]
=
finv
}
// XXX use δfile blocks -> finv.blkmap
finv
.
size
=
true
file
.
δtail
.
Append
(
δF
.
Rev
,
δfile
.
Elements
())
}
//fmt.Printf("\n\nzδhandle: toinvalidate (#%d):\n", len(toinvalidate))
...
...
@@ -898,6 +902,7 @@ retry:
}
// XXX δFtail.ForgetPast(...)
// XXX for f in toinvalidate: f.δtail.ForgetPast(...)
}
// invalidateBlk invalidates 1 file block in kernel cache.
...
...
@@ -1367,20 +1372,18 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
return
fmt
.
Errorf
(
"at is too far away back from head/at"
)
}
//
XXX register w to f
early, so that READs going in parallel to us
//
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 .
toPin
:=
map
[
int64
]
zodb
.
Tid
{}
// blk -> @rev
// XXX locking ok?
bfdir
.
δFmu
.
RLock
()
defer
bfdir
.
δFmu
.
RUnlock
()
// XXX locking
// pin all tracked file blocks that were changed (at, head] range
for
_
,
δfile
:=
range
bfdir
.
δFtail
.
SliceByFileRev
(
f
,
at
,
head
.
zconn
.
At
())
{
for
blk
:=
range
δfile
.
Change
{
for
_
,
δfile
:=
range
f
.
δtail
.
SliceByRev
(
at
,
head
.
zconn
.
At
())
{
for
_
,
blk
:=
range
δfile
.
Changev
{
_
,
already
:=
toPin
[
blk
]
if
already
{
continue
...
...
@@ -1737,7 +1740,6 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
return
nil
,
err
}
// zconn.Incref()
f
:=
&
BigFile
{
fsNode
:
newFSNode
(
&
fsOptions
{
Sticky
:
false
}),
// XXX + BigFile.OnForget -> del .head.bfdir.fileTab[]
head
:
head
,
...
...
@@ -1745,17 +1747,19 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
blksize
:
blksize
,
size
:
size
,
rev
:
rev
,
// // XXX this is needed only for head/
// δtail: NewΔTailI64(zconn.At()),
loading
:
make
(
map
[
int64
]
*
blkLoadState
),
}
// only head/ needs δFtail.
// only head/ needs f.δtail
// only head/ needs δFtail & f.δtail.
if
head
.
rev
==
0
{
head
.
bfdir
.
δFmu
.
Lock
()
// XXX locking ok?
head
.
bfdir
.
δFtail
.
Track
(
f
,
treePath
)
head
.
bfdir
.
δFmu
.
Unlock
()
f
.
δtail
=
NewΔTailI64
(
zconn
.
At
())
}
return
f
,
nil
...
...
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