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
53148c8e
Commit
53148c8e
authored
Apr 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
55d3f53c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
43 deletions
+45
-43
wcfs/wcfs.go
wcfs/wcfs.go
+4
-3
wcfs/δbtail.go
wcfs/δbtail.go
+38
-39
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+2
-0
wcfs/δftail.go
wcfs/δftail.go
+1
-1
No files found.
wcfs/wcfs.go
View file @
53148c8e
...
...
@@ -616,6 +616,7 @@ type BigFile struct {
// δtail *ΔTailI64 // [](rev↑, []#blk)
// blocks that were ever read-accessed (head/ only) XXX locking by bfdir.δFmu ?
// XXX = δFtail.Tracked(f) ?
accessed
SetI64
// inflight loadings of ZBigFile from ZODB.
...
...
@@ -1275,9 +1276,9 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
// into missing both kernel pagecache (if not yet updated) and empty .loading[blk],
// and thus would trigger DB access again.
//
//
XXX
if direct-io: don't touch pagecache
//
XXX
upload parts only not covered by currrent read (not to e.g. wait for page lock)
//
XXX
skip upload completely if read is wide to cover whole blksize
//
TODO
if direct-io: don't touch pagecache
//
TODO
upload parts only not covered by currrent read (not to e.g. wait for page lock)
//
TODO
skip upload completely if read is wide to cover whole blksize
go
f
.
uploadBlk
(
blk
,
loading
)
return
nil
...
...
wcfs/δbtail.go
View file @
53148c8e
...
...
@@ -165,7 +165,7 @@ type ΔBtail struct {
δZtail
*
zodb
.
ΔTail
// XXX vvv keys ∈ tracked -> keys ∈ kadj[tracked] ?
//
δRtail []ΔRoots // which BTree were changed
; Noted only by keys ∈ tracked subset
//
vδB []ΔB // data with δB changes
; Noted only by keys ∈ tracked subset
byRoot
map
[
zodb
.
Oid
]
*
ΔTtail
// {} root -> [] k/v change history; only for keys ∈ tracked subset
// handle to make connections to access database.
...
...
@@ -184,6 +184,34 @@ type ΔBtail struct {
// trackNew SetOid
}
// ΔB represents a change in BTrees space.
type
ΔB
struct
{
Rev
zodb
.
Tid
ByRoot
map
[
zodb
.
Oid
]
map
[
Key
]
ΔValue
// {} root -> {}(key, δvalue)
}
// ΔTtail represent tail of revisional changes to one BTree.
//
// See ΔBtail documentation for details.
type
ΔTtail
struct
{
vδT
[]
ΔTree
// changes to tree keys; rev↑. covers keys ∈ tracked subset
// {}k/v @tail for keys that are changed in (tail, head].
KVAtTail
map
[
Key
]
Value
// XXX not needed since vδT has ΔValue ?
// index for LastRevOf queries
lastRevOf
map
[
Key
]
zodb
.
Tid
// {} key -> last
}
// ΔTree describes changes to one BTree in one revision.
// XXX -> ΔT ?
type
ΔTree
struct
{
Rev
zodb
.
Tid
KV
map
[
Key
]
Value
// XXX Value -> ΔValue ?
}
// XXX place
type
trackIndex
map
[
zodb
.
Oid
]
*
nodeTrack
...
...
@@ -309,40 +337,6 @@ func (hi treeSetKey) GetInRange(lo, hi_ Key) SetKey {
return
ret
}
// ΔB represents a change in BTrees space.
type
ΔB
struct
{
Rev
zodb
.
Tid
ByRoot
map
[
zodb
.
Oid
]
map
[
Key
]
ΔValue
// {} root -> {}(key, δvalue)
}
/*
// ΔRoots describes which BTrees were change in one revision.
type ΔRoots struct {
Rev zodb.Tid
Roots []*Tree // root XXX -> Oid? XXX -> SetTree?
}
*/
// ΔTtail represent tail of revisional changes to one BTree.
//
// See ΔBtail documentation for details.
type
ΔTtail
struct
{
vδT
[]
ΔTree
// changes to tree keys; rev↑. covers keys ∈ tracked subset
// {}k/v @tail for keys that are changed in (tail, head].
KVAtTail
map
[
Key
]
Value
// XXX not needed since vδT has ΔValue ?
// index for LastRevOf queries
lastRevOf
map
[
Key
]
zodb
.
Tid
// {} key -> last
}
// ΔTree describes changes to one BTree in one revision.
// XXX -> ΔT ?
type
ΔTree
struct
{
Rev
zodb
.
Tid
KV
map
[
Key
]
Value
// XXX Value -> ΔValue ?
}
// NewΔBtail creates new empty ΔBtail object.
//
// Initial tracked set is empty.
...
...
@@ -1348,13 +1342,16 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
// entries in .δZtail into account.
// func (δBtail *ΔBtail) update()
// Get returns root[key] as of @at database state plus revision that changed it.
//
// if revExact=False - rev is upper estimate for the revision.
//
// XXX at must ∈ (tail, head] XXX [tail ?
// XXX key must be tracked
func
(
δΒtail
*
ΔBtail
)
Get
(
ctx
context
.
Context
,
root
*
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
value
Value
,
ok
bool
,
rev
zodb
.
Tid
,
revExact
bool
,
err
error
)
{
//
// XXX naming -> GetAt ?
func
(
δBtail
*
ΔBtail
)
Get
(
ctx
context
.
Context
,
root
*
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
value
Value
,
ok
bool
,
rev
zodb
.
Tid
,
revExact
bool
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"δBtail: root<%s>: get %d @%s"
,
root
.
POid
(),
key
,
at
)
// XXX key not tracked -> panic
// XXX at not ∈ (tail, head] -> panic
...
...
@@ -1367,7 +1364,7 @@ func (δΒtail *ΔBtail) Get(ctx context.Context, root *Tree, key Key, at zodb.T
// XXX dirty -> rebuild
// XXX -> index lastXXXOf(key) | linear scan ↓ looking for change <= at
δTtail
:=
δ
Β
tail
.
byRoot
[
root
.
POid
()]
δTtail
:=
δ
B
tail
.
byRoot
[
root
.
POid
()]
if
δTtail
==
nil
{
panicf
(
"δBtail: root<%s> not tracked"
,
root
.
POid
())
}
...
...
@@ -1391,13 +1388,15 @@ func (δΒtail *ΔBtail) Get(ctx context.Context, root *Tree, key Key, at zodb.T
}
// key not in history tail.
// either use @tail[key], if it is present, or @head[key]
rev
=
δ
Β
tail
.
Tail
()
// either use @tail[key], if it is present, or @head[key]
FIXME tail[key] must be present
rev
=
δ
B
tail
.
Tail
()
revExact
=
false
value
,
ok
=
δTtail
.
KVAtTail
[
key
]
if
ok
{
return
}
// FIXME this should go away (tail[key] must be present)
// @tail[key] is not present - key was not changing in (tail, head].
// since at ∈ (tail, head] we can use @head[key] as the result
xvalue
,
ok
,
err
:=
root
.
Get
(
ctx
,
key
)
...
...
wcfs/δbtail_test.go
View file @
53148c8e
...
...
@@ -853,6 +853,8 @@ func testΔBTail(t *testing.T, testq chan ΔBTestEntry) {
tracef
(
"
\n\n\n
**** %s ****
\n\n
"
,
subj
)
xverifyΔBTail
(
t
,
subj
,
db
,
tg
.
treeRoot
,
at1
,
at2
,
xkv1
,
xkv2
,
δZ
,
test
.
kadjOK
)
// XXX also verify ΔBtail.Get + ...
at1
=
at2
xkv1
=
xkv2
tree1
=
tree2
...
...
wcfs/δftail.go
View file @
53148c8e
...
...
@@ -476,7 +476,7 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, f *BigFile, blk int64, a
// XXX activate zfile?
zblkOid
,
ok
,
tabRev
,
tabRevExact
,
err
:=
δFtail
.
δBtail
.
Get
(
ctx
,
f
.
zfile
.
blktab
,
blk
,
at
)
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
// XXX
}
// block was removed
...
...
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