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
55d3f53c
Commit
55d3f53c
authored
Apr 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
539ec405
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
wcfs/wcfs.go
wcfs/wcfs.go
+4
-4
wcfs/δbtail.go
wcfs/δbtail.go
+5
-4
wcfs/δftail.go
wcfs/δftail.go
+9
-7
No files found.
wcfs/wcfs.go
View file @
55d3f53c
...
@@ -863,9 +863,9 @@ retry:
...
@@ -863,9 +863,9 @@ retry:
return
err
return
err
}
}
if
false
{
// XXX -> V(2) ?
if
!
log
.
V
(
2
)
{
// debug dump δF
// debug dump δF
fmt
.
Print
f
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
log
.
Info
f
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
for
file
,
δfile
:=
range
δF
.
ByFile
{
for
file
,
δfile
:=
range
δF
.
ByFile
{
blkv
:=
δfile
.
Blocks
.
Elements
()
blkv
:=
δfile
.
Blocks
.
Elements
()
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
...
@@ -875,9 +875,9 @@ retry:
...
@@ -875,9 +875,9 @@ retry:
if
δfile
.
Size
{
if
δfile
.
Size
{
size
=
"S"
size
=
"S"
}
}
fmt
.
Print
f
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
log
.
Info
f
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
}
}
fmt
.
Print
f
(
"
\n\n
"
)
log
.
Info
f
(
"
\n\n
"
)
}
}
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
...
...
wcfs/δbtail.go
View file @
55d3f53c
...
@@ -120,7 +120,7 @@ type ΔValue struct {
...
@@ -120,7 +120,7 @@ type ΔValue struct {
// It semantically consists of
// It semantically consists of
//
//
// []δB ; rev ∈ (tail, head]
// []δB ; rev ∈ (tail, head]
// atTail
// atTail
XXX no need (see vvv)
//
//
// where δB represents a change in BTrees space
// where δB represents a change in BTrees space
//
//
...
@@ -154,10 +154,11 @@ type ΔValue struct {
...
@@ -154,10 +154,11 @@ type ΔValue struct {
// that ∈ BTree subgraphs that were explicitly requested to be tracked by δB.
// that ∈ BTree subgraphs that were explicitly requested to be tracked by δB.
//
//
// XXX incremental; not full coverage
// XXX incremental; not full coverage
// XXX see also zodb.ΔTail .
//
//
// ΔBtail is not safe for concurrent access.
// ΔBtail is not safe for concurrent access.
// XXX -> multiple readers / single writer?
// XXX -> multiple readers / single writer?
//
// See also zodb.ΔTail
type
ΔBtail
struct
{
type
ΔBtail
struct
{
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// includes all changed objects, not only tracked ones.
// includes all changed objects, not only tracked ones.
...
@@ -347,8 +348,8 @@ type ΔTree struct {
...
@@ -347,8 +348,8 @@ type ΔTree struct {
// Initial tracked set is empty.
// Initial tracked set is empty.
// Initial coverage is (at₀, at₀].
// Initial coverage is (at₀, at₀].
//
//
// db will be used by ΔBtail to open database connections
... XXX
// db will be used by ΔBtail to open database connections
to load data from
// XXX or caller provides zhead/zprev explicitly?
//
ZODB when needed.
XXX or caller provides zhead/zprev explicitly?
func
NewΔBtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔBtail
{
func
NewΔBtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔBtail
{
return
&
ΔBtail
{
return
&
ΔBtail
{
δZtail
:
zodb
.
NewΔTail
(
at0
),
δZtail
:
zodb
.
NewΔTail
(
at0
),
...
...
wcfs/δftail.go
View file @
55d3f53c
...
@@ -24,6 +24,7 @@ package main
...
@@ -24,6 +24,7 @@ package main
import
(
import
(
"context"
"context"
"fmt"
"runtime"
"runtime"
"sync"
"sync"
...
@@ -95,7 +96,6 @@ type ΔFile struct {
...
@@ -95,7 +96,6 @@ type ΔFile struct {
Size
bool
// whether file size changed
Size
bool
// whether file size changed
}
}
// zblkInΔFtail is ΔFtail-related volatile data embedded into ZBlk*.
// zblkInΔFtail is ΔFtail-related volatile data embedded into ZBlk*.
//
//
// The data is preserved even when ZBlk comes to ghost state, but is lost if
// The data is preserved even when ZBlk comes to ghost state, but is lost if
...
@@ -120,7 +120,8 @@ func (z *zblkInΔFtail) inΔFtail() *zblkInΔFtail { return z }
...
@@ -120,7 +120,8 @@ func (z *zblkInΔFtail) inΔFtail() *zblkInΔFtail { return z }
// Initial tracked set is empty.
// Initial tracked set is empty.
// Initial coverage of created ΔFtail is (at₀, at₀].
// Initial coverage of created ΔFtail is (at₀, at₀].
//
//
// XXX db
// db will be used by ΔFtail to open database connections to load data from
// ZODB when needed.
func
NewΔFtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔFtail
{
func
NewΔFtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔFtail
{
return
&
ΔFtail
{
return
&
ΔFtail
{
δBtail
:
NewΔBtail
(
at0
,
db
),
δBtail
:
NewΔBtail
(
at0
,
db
),
...
@@ -134,7 +135,7 @@ func (δFtail *ΔFtail) Head() zodb.Tid { return δFtail.δBtail.Head() }
...
@@ -134,7 +135,7 @@ func (δFtail *ΔFtail) Head() zodb.Tid { return δFtail.δBtail.Head() }
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Tail
()
}
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Tail
()
}
// Track associates file[blk]
with tree path and zblk object there
.
// Track associates file[blk]
@head with tree path and zblk object
.
//
//
// zblk can be nil, which represents a hole.
// zblk can be nil, which represents a hole.
// XXX blk=-1 is used for tracking after Size (no zblk is accessed at all).
// XXX blk=-1 is used for tracking after Size (no zblk is accessed at all).
...
@@ -143,6 +144,8 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
...
@@ -143,6 +144,8 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
//
//
// XXX text
// XXX text
//
//
// XXX objects in path and zblk must be with .PJar().At() == .head
//
// A root can be associated with several files (each provided on different Track call).
// A root can be associated with several files (each provided on different Track call).
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
blk
int64
,
path
[]
btree
.
LONode
,
zblk
ZBlk
)
{
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
blk
int64
,
path
[]
btree
.
LONode
,
zblk
ZBlk
)
{
if
blk
==
-
1
{
if
blk
==
-
1
{
...
@@ -225,7 +228,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
...
@@ -225,7 +228,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
for
root
,
δt
:=
range
δB
.
ByRoot
{
for
root
,
δt
:=
range
δB
.
ByRoot
{
files
:=
δFtail
.
fileIdx
[
root
]
files
:=
δFtail
.
fileIdx
[
root
]
if
len
(
files
)
==
0
{
if
len
(
files
)
==
0
{
panicf
(
"
ΔFtail: root<%s> -> ø file
"
,
root
)
panicf
(
"
BUG: ΔFtail: root<%s> -> ø files
"
,
root
)
}
}
for
file
:=
range
files
{
for
file
:=
range
files
{
δfile
,
ok
:=
δF
.
ByFile
[
file
]
δfile
,
ok
:=
δF
.
ByFile
[
file
]
...
@@ -277,11 +280,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
...
@@ -277,11 +280,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
// XXX update z.infile according to btree changes
// XXX update z.infile according to btree changes
case
*
ZBigFile
:
case
*
ZBigFile
:
//
XXX
check that .blksize and .blktab (it is only
//
TODO
check that .blksize and .blktab (it is only
// persistent reference) do not change.
// persistent reference) do not change.
// XXX shutdown fs with ^^^ message.
return
ΔF
{},
fmt
.
Errorf
(
"ZBigFile<%s> changed @%s"
,
oid
,
δZ
.
Tid
)
panic
(
"ZBigFile changed"
)
}
}
// make sure obj won't be garbage-collected until we finish handling it.
// make sure obj won't be garbage-collected until we finish handling it.
...
...
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