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
1717400a
Commit
1717400a
authored
Jun 11, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f2d3cd40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+15
-15
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
1717400a
...
...
@@ -38,7 +38,7 @@ import (
const
XXX_killWhenRebuildWorks
=
true
const
traceΔBtail
=
true
const
debugΔBtail
=
fals
e
const
debugΔBtail
=
tru
e
// ΔBtail represents tail of revisional changes to BTrees.
...
...
@@ -222,7 +222,7 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, nodePath []Node) error {
pathv
:=
[]
string
{}
for
_
,
node
:=
range
nodePath
{
pathv
=
append
(
pathv
,
vnode
(
node
))
}
tracefΔBtail
(
"Track [%v] %s
\n
"
,
key
,
strings
.
Join
(
pathv
,
" -> "
))
tracefΔBtail
(
"
\n
Track [%v] %s
\n
"
,
key
,
strings
.
Join
(
pathv
,
" -> "
))
return
δBtail
.
track
(
key
,
keyPresent
,
path
)
}
...
...
@@ -233,7 +233,6 @@ func (δBtail *ΔBtail) track(key Key, keyPresent bool, path []zodb.Oid) error {
// track is track of path[-1] (i.e. leaf)
// XXX hack - until rebuild is implemented
if
XXX_killWhenRebuildWorks
{
_
,
ok
:=
δBtail
.
byRoot
[
root
]
...
...
@@ -253,8 +252,9 @@ func (δBtail *ΔBtail) rebuild() (err error) {
defer
xerr
.
Context
(
&
err
,
"ΔBtail rebuild"
)
// XXX locking
// XXX tracefΔBtail rebuild @head
// XXX tracefΔBtail trackNew: ...
tracefΔBtail
(
"
\n
Rebuild @%s .. @%s
\n
"
,
δBtail
.
Tail
(),
δBtail
.
Head
())
tracefΔBtail
(
"trackSet: %v
\n
"
,
δBtail
.
trackSet
)
tracefΔBtail
(
"trackNew: %v
\n
"
,
δBtail
.
trackNew
)
trackNew
:=
δBtail
.
trackNew
δBtail
.
trackNew
=
PPTreeSubSet
{}
...
...
@@ -280,10 +280,10 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δZTC
,
δtopsByRoot
:=
δZConnectTracked
(
δZ
.
Changev
,
trackNew
)
debugfΔBtail
(
"
\n
rebuild @%s <- @%s
\n
"
,
atPrev
,
δZ
.
Rev
)
debugfΔBtail
(
"δZ:
\t
%v
\n
"
,
δZ
.
Changev
)
debugfΔBtail
(
"trackNew: %v
\n
"
,
trackNew
)
debugfΔBtail
(
"trackSet: %v
\n
"
,
δBtail
.
trackSet
)
// XXX needed?
debugfΔBtail
(
"
\n
rebuild @%s <- @%s
\n
"
,
atPrev
,
δZ
.
Rev
)
debugfΔBtail
(
"
δZ:
\t
%v
\n
"
,
δZ
.
Changev
)
debugfΔBtail
(
"
trackNew: %v
\n
"
,
trackNew
)
debugfΔBtail
(
"
trackSet: %v
\n
"
,
δBtail
.
trackSet
)
// XXX needed?
defer
debugfΔBtail
(
"
\n\n
"
)
// XXX len(δtopsByRoot) == 0 -> skip
...
...
@@ -309,7 +309,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
return
err
}
debugfΔBtail
(
"-> root<%s> δkv*: %v δtrack*: %v
\n
"
,
root
,
δT
,
δtrack
)
debugfΔBtail
(
"
-> root<%s> δkv*: %v δtrack*: %v
\n
"
,
root
,
δT
,
δtrack
)
trackNew
.
ApplyΔ
(
δtrack
)
vδtrack
=
append
([]
*
ΔPPTreeSubSet
{
δtrack
},
vδtrack
...
)
...
...
@@ -382,6 +382,10 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
headOld
:=
δBtail
.
Head
()
defer
xerr
.
Contextf
(
&
err
,
"ΔBtail update %s -> %s"
,
headOld
,
δZ
.
Tid
)
tracefΔBtail
(
"
\n
Update @%s -> @%s δZ: %v
\n
"
,
δBtail
.
Head
(),
δZ
.
Tid
,
δZ
.
Changev
)
tracefΔBtail
(
"trackSet: %v
\n
"
,
δBtail
.
trackSet
)
tracefΔBtail
(
"trackNew: %v
\n
"
,
δBtail
.
trackNew
)
if
XXX_killWhenRebuildWorks
{
// XXX hack - until vvv is reenabled
δBtail
.
trackSet
.
UnionInplace
(
δBtail
.
trackNew
)
...
...
@@ -395,10 +399,6 @@ if XXX_killWhenRebuildWorks {
}
}
tracefΔBtail
(
"Update @%s -> @%s
\n
"
,
δBtail
.
Head
(),
δZ
.
Tid
)
tracefΔBtail
(
"δZ:
\t
%v
\n
"
,
δZ
.
Changev
)
debugfΔBtail
(
"trackSet: %v
\n
"
,
δBtail
.
trackSet
)
// XXX dup wrt rebuild?
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
...
...
@@ -431,7 +431,7 @@ if XXX_killWhenRebuildWorks {
return
ΔB
{},
err
}
debug
fΔBtail
(
"
\n
-> root<%s> δkv: %v δtrack: %v
\n
"
,
root
,
δT
,
δtrack
)
trace
fΔBtail
(
"
\n
-> root<%s> δkv: %v δtrack: %v
\n
"
,
root
,
δT
,
δtrack
)
if
len
(
δT
)
>
0
{
// an object might be resaved without change
δB
.
ByRoot
[
root
]
=
δT
...
...
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