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
d0d95b64
Commit
d0d95b64
authored
Jun 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
db2d5e41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+6
-15
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
d0d95b64
...
@@ -242,6 +242,7 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) error { // XXX Tree|Buck
...
@@ -242,6 +242,7 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) error { // XXX Tree|Buck
pathv
:=
[]
string
{}
pathv
:=
[]
string
{}
for
_
,
node
:=
range
nodePath
{
pathv
=
append
(
pathv
,
vnode
(
node
))
}
for
_
,
node
:=
range
nodePath
{
pathv
=
append
(
pathv
,
vnode
(
node
))
}
tracefΔBtail
(
"
\n
Track [%v] %s
\n
"
,
key
,
strings
.
Join
(
pathv
,
" -> "
))
tracefΔBtail
(
"
\n
Track [%v] %s
\n
"
,
key
,
strings
.
Join
(
pathv
,
" -> "
))
tracefΔBtail
(
"trackSet: %s
\n
"
,
δBtail
.
trackSet
)
// XXX locking
return
δBtail
.
track
(
key
,
path
)
return
δBtail
.
track
(
key
,
path
)
}
}
...
@@ -291,6 +292,8 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
...
@@ -291,6 +292,8 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
trackNewRoots
:=
δBtail
.
trackNewRoots
trackNewRoots
:=
δBtail
.
trackNewRoots
tracefΔBtail
(
"
\n
RebuildAll @%s..@%s trackNewRoots: %s
\n
"
,
δBtail
.
Tail
(),
δBtail
.
Head
(),
trackNewRoots
)
for
root
:=
range
trackNewRoots
{
for
root
:=
range
trackNewRoots
{
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
...
@@ -313,7 +316,7 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
...
@@ -313,7 +316,7 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
defer
xerr
.
Context
(
&
err
,
"ΔTtail rebuild"
)
defer
xerr
.
Context
(
&
err
,
"ΔTtail rebuild"
)
// XXX locking
// XXX locking
tracefΔBtail
(
"
\n
Rebuild
@%s .. @%s
\n
"
,
δZtail
.
Tail
(),
δZtail
.
Head
())
tracefΔBtail
(
"
\n
Rebuild
%s @%s .. @%s
\n
"
,
root
,
δZtail
.
Tail
(),
δZtail
.
Head
())
tracefΔBtail
(
"trackNew: %v
\n
"
,
δTtail
.
trackNew
)
tracefΔBtail
(
"trackNew: %v
\n
"
,
δTtail
.
trackNew
)
trackNew
:=
δTtail
.
trackNew
trackNew
:=
δTtail
.
trackNew
...
@@ -372,7 +375,7 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
...
@@ -372,7 +375,7 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
zhead
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{
At
:
δZtail
.
Head
()});
/*X*/
if
err
!=
nil
{
return
err
}
zhead
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{
At
:
δZtail
.
Head
()});
/*X*/
if
err
!=
nil
{
return
err
}
xtree
,
err
:=
zhead
.
Get
(
ctx
,
root
);
/*X*/
if
err
!=
nil
{
return
err
}
xtree
,
err
:=
zhead
.
Get
(
ctx
,
root
);
/*X*/
if
err
!=
nil
{
return
err
}
tree
:=
xtree
.
(
*
Tree
)
// must succeed
tree
:=
xtree
.
(
*
Tree
)
// must succeed
XXX better explicit panic?
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
tree
}
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
tree
}
V
:=
rangeSplit
{
top
}
V
:=
rangeSplit
{
top
}
...
@@ -399,17 +402,6 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
...
@@ -399,17 +402,6 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
}
}
return
trackNew
,
nil
return
trackNew
,
nil
/*
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
// Remap it back to @head and merge to .trackSet
for _, δtrack := range vδtrack {
δtrack.Reverse() // we saved it as lo<-hi; now we go lo->hi
trackNew.ApplyΔ(δtrack)
}
δBtail.trackSet.UnionInplace(trackNew)
return δtrackSet, nil
*/
}
}
// rebuild1 rebuilds δT for single δZ.
// rebuild1 rebuilds δT for single δZ.
...
@@ -603,8 +595,7 @@ if XXX_killWhenRebuildWorks {
...
@@ -603,8 +595,7 @@ if XXX_killWhenRebuildWorks {
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
// XXX if δtkeycov != ø -> rebuild δTtail
// XXX if δtkeycov != ø && len(δZtail) > 1 -> rebuild δTtail
// XXX here? or in the caller?
}
}
return
δB
,
δTKeyCov
,
nil
return
δB
,
δTKeyCov
,
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