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
7973b942
Commit
7973b942
authored
Jun 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f626ec3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
17 deletions
+31
-17
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+31
-17
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
7973b942
...
...
@@ -282,7 +282,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
for
root
:=
range
trackNewRoots
{
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
δtrackSet
,
err
:=
δTtail
.
rebuild
(
δBtail
.
δZtail
,
δBtail
.
db
)
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
if
err
!=
nil
{
return
err
}
...
...
@@ -298,7 +298,7 @@ func (δBtail *ΔBtail) rebuildAll() (err error) {
// It returns set of nodes that must be added to ΔBtail.trackSet to account for
// keys that becomes tracked. Note: this set is potentially wider compared to what was in .trackNew.
// XXX place
func
(
δTtail
*
ΔTtail
)
rebuild
(
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
δtrackSet
PPTreeSubSet
,
err
error
)
{
func
(
δTtail
*
ΔTtail
)
rebuild
(
root
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
δtrackSet
PPTreeSubSet
,
err
error
)
{
defer
xerr
.
Context
(
&
err
,
"ΔTtail rebuild"
)
// XXX locking
...
...
@@ -352,27 +352,42 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
break
}
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
root
}
V
:=
rangeSplit
{
top
}
for
_
,
r
:=
δtkeycov
.
AllRanges
()
{
lo
:=
r
.
lo
for
{
b
,
err
:=
V
.
GetToLeaf
(
ctx
,
lo
)
if
err
!=
nil
{
return
nil
,
err
}
widenTrackNew
:=
func
()
error
{
// XXX errctx, debug
txn
,
ctx
:=
transaction
.
New
(
context
.
TODO
())
// XXX
defer
txn
.
Abort
()
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
}
tree
:=
xtree
.
(
*
Tree
)
// must succeed
trackNew
.
AddPath
(
b
.
Path
())
top
:=
&
nodeInRange
{
prefix
:
nil
,
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
tree
}
V
:=
rangeSplit
{
top
}
for
_
,
r
:=
range
δtkeycov
.
AllRanges
()
{
lo
:=
r
.
lo
for
{
b
,
err
:=
V
.
GetToLeaf
(
ctx
,
lo
);
/*X*/
if
err
!=
nil
{
return
err
}
trackNew
.
AddPath
(
b
.
Path
())
// continue with next right bucket until r coverage is complete
if
r
.
hi_
<=
b
.
hi_
{
break
// continue with next right bucket until r coverage is complete
if
r
.
hi_
<=
b
.
hi_
{
break
}
lo
=
b
.
hi_
+
1
}
lo
=
b
.
hi_
+
1
}
return
nil
}
err
:=
widenTrackNew
()
if
err
!=
nil
{
return
nil
,
err
}
}
return
trackNew
,
nil
/*
// trackNew was adjusted to correspond to @tail potentially growing its key coverage.
...
...
@@ -384,7 +399,6 @@ func (δTtail *ΔTtail) rebuild(δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet P
δBtail.trackSet.UnionInplace(trackNew)
return δtrackSet, nil
*/
return
trackNew
}
// rebuild1 rebuilds δT for single δZ.
...
...
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