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
b4137415
Commit
b4137415
authored
Apr 21, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3aff490b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
wcfs/wcfs.go
wcfs/wcfs.go
+23
-19
wcfs/zblk.go
wcfs/zblk.go
+1
-1
wcfs/δftail.go
wcfs/δftail.go
+1
-0
No files found.
wcfs/wcfs.go
View file @
b4137415
...
@@ -257,10 +257,10 @@ package main
...
@@ -257,10 +257,10 @@ package main
// 2) head/bigfile/* of all bigfiles represent state as of zhead.At .
// 2) head/bigfile/* of all bigfiles represent state as of zhead.At .
// 3) for head/bigfile/* the following invariant is maintained:
// 3) for head/bigfile/* the following invariant is maintained:
//
//
// #blk ∈ OS file cache
=> ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead
cache(%)
// #blk ∈ OS file cache
=> ZBlk(#blk) + all BTree/Bucket that lead to it ∈ zhead live
cache(%)
//
(ZBlk* in ghost state)
// (ZBlk* in ghost state)
//
//
// =>
all BTree/Bucket that lead to blk are tracked (XXX)
// => all BTree/Bucket that lead to blk are tracked (XXX)
//
//
// The invariant helps on invalidation: if we see a changed oid, and
// The invariant helps on invalidation: if we see a changed oid, and
// zhead.cache.lookup(oid) = ø -> we know we don't have to invalidate OS
// zhead.cache.lookup(oid) = ø -> we know we don't have to invalidate OS
...
@@ -848,22 +848,24 @@ retry:
...
@@ -848,22 +848,24 @@ retry:
// invalidate kernel cache for data in changed files
// invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked
// NOTE no δFmu lock needed because zhead is WLocked
δF
:=
bfdir
.
δFtail
.
Update
(
δZ
,
zhead
)
if
false
{
δF
:=
bfdir
.
δFtail
.
Update
(
δZ
,
zhead
)
// δF <- δZ |tracked
fmt
.
Printf
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
for
file
,
δfile
:=
range
δF
.
ByFile
{
if
false
{
// XXX -> V(2) ?
blkv
:=
δfile
.
Blocks
.
Elements
()
// debug dump δF
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
fmt
.
Printf
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
return
blkv
[
i
]
<
blkv
[
j
]
for
file
,
δfile
:=
range
δF
.
ByFile
{
})
blkv
:=
δfile
.
Blocks
.
Elements
()
size
:=
" "
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
if
δfile
.
Size
{
return
blkv
[
i
]
<
blkv
[
j
]
size
=
"S"
})
size
:=
" "
if
δfile
.
Size
{
size
=
"S"
}
fmt
.
Printf
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
}
}
fmt
.
Printf
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
fmt
.
Printf
(
"
\n\n
"
)
}
fmt
.
Printf
(
"
\n\n
"
)
}
}
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
...
@@ -876,7 +878,7 @@ retry:
...
@@ -876,7 +878,7 @@ retry:
for
blk
:=
range
δfile
.
Blocks
{
for
blk
:=
range
δfile
.
Blocks
{
blk
:=
blk
blk
:=
blk
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
return
file
.
invalidateBlk
(
ctx
,
blk
)
// XXX +ctx ?
return
file
.
invalidateBlk
(
ctx
,
blk
)
})
})
}
}
}
}
...
@@ -1472,7 +1474,9 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
...
@@ -1472,7 +1474,9 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// fmt.Printf("S: read #%d -> pin watchers (#%d)\n", blk, len(f.watchTab))
// fmt.Printf("S: read #%d -> pin watchers (#%d)\n", blk, len(f.watchTab))
// update δFtail index
// update δFtail index XXX -> move upper into readBlk ?
// (δFtail is just for δZ -> δF invalidation handling and is needed without isolation protocol)
// XXX ^^^ no - also need to query to send pins
bfdir
:=
f
.
head
.
bfdir
bfdir
:=
f
.
head
.
bfdir
bfdir
.
δFmu
.
Lock
()
// XXX locking correct? XXX -> better push down?
bfdir
.
δFmu
.
Lock
()
// XXX locking correct? XXX -> better push down?
bfdir
.
δFtail
.
Track
(
f
,
blk
,
treepath
,
zblk
)
// XXX pass in zblk.rev here?
bfdir
.
δFtail
.
Track
(
f
,
blk
,
treepath
,
zblk
)
// XXX pass in zblk.rev here?
...
...
wcfs/zblk.go
View file @
b4137415
...
@@ -459,7 +459,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
...
@@ -459,7 +459,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
//
//
// it also returns:
// it also returns:
//
//
// - BTree path in .blktab
for
loaded block,
// - BTree path in .blktab
to
loaded block,
// - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
// - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
// which provides a rough upper-bound estimate for file[blk] revision.
// which provides a rough upper-bound estimate for file[blk] revision.
//
//
...
...
wcfs/δftail.go
View file @
b4137415
...
@@ -428,6 +428,7 @@ func (δFtail *ΔFtail) SliceByFileRev(file *BigFile, lo, hi zodb.Tid) /*readonl
...
@@ -428,6 +428,7 @@ func (δFtail *ΔFtail) SliceByFileRev(file *BigFile, lo, hi zodb.Tid) /*readonl
}
}
// XXX -> ΔFtail.BlkRevAt (meth of ΔFtail, not file)
// XXX -> BlkRevAt
// XXX -> BlkRevAt
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
// LastBlkRev returns last revision that changed file[blk] as of @at database state.
//
//
...
...
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