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
e09b503e
Commit
e09b503e
authored
Jun 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2f9a46eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+26
-22
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
e09b503e
...
...
@@ -329,8 +329,8 @@ func (δTtail *ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB
// go backwards and merge vδT <- treediff(lo..hi/trackNew)
vδZ
:=
δZtail
.
Data
()
for
{
δtkeycov
:=
&
RangedKeySet
{}
// all keys coming into tracking set during this lo
..
hi scan
trackNewCur
:=
trackNew
.
Clone
()
// trackNew adjusted when going to i<- entry
δtkeycov
:=
&
RangedKeySet
{}
// all keys coming into tracking set during this lo
<-
hi scan
trackNewCur
:=
trackNew
.
Clone
()
// trackNew adjusted
as of
when going to i<- entry
for
i
:=
len
(
vδZ
)
-
1
;
i
>=
0
;
i
--
{
δZ
:=
vδZ
[
i
]
...
...
@@ -576,27 +576,36 @@ if XXX_killWhenRebuildWorks {
tracefΔBtail
(
"
\n
-> root<%s> δkv: %v δtrack: %v δtkeycov: %v
\n
"
,
root
,
δT
,
δtrack
,
δtkeycov
)
δTtail
:=
δBtail
.
vδTbyRoot
[
root
]
// must be there
if
len
(
δT
)
>
0
{
// an object might be resaved without change
δB
.
ΔByRoot
[
root
]
=
δT
δTtail
,
ok
:=
δBtail
.
vδTbyRoot
[
root
]
if
!
ok
{
// XXX should not happen (only roots requested to be present are present in δ)
// this root was not tracked before -> create δTtail for it with empty changes
δTtail
=
newΔTtail
()
δBtail
.
vδTbyRoot
[
root
]
=
δTtail
}
δB
.
ΔByRoot
[
root
]
=
δT
// XXX after rebuild
δTtail
.
vδT
=
append
(
δTtail
.
vδT
,
ΔTree
{
Rev
:
δZ
.
Tid
,
ΔKV
:
δT
})
// XXX rebuild KVAtTail
// XXX rebuild lastRevOf
}
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
// XXX if δtkeycov != ø && len(δZtail) > 1 -> rebuild δTtail
// XXX do this
// δtkeycov != ø -> rebuild δTtail
//
// XXX NOTE `len(δZtail) > 1` check is not only optimization - it is
// important for tests: xverifyΔBTail_Update calls ΔBtail._Update with
// only one revision inside δZtail, and this way also directly exercises
// treediff. Should we drop `len(δZtail) > 1` check here, that test will
// no longer directly exercise treediff behaviour.
if
!
δtkeycov
.
Empty
()
&&
δBtail
.
δZtail
.
Len
()
>
1
{
δTtail
.
trackNew
=
...
// ~δtkeycov
δtrackSet
,
err
:=
δTtail
.
rebuild
(
root
,
δBtail
.
δZtail
,
δBtail
.
db
)
if
err
!=
nil
{
return
ΔB
{},
δTKeyCov
,
err
}
δBtail
.
trackSet
.
UnionInplace
(
δtrackSet
)
// XXX Update δTKeyCov? XXX or it is needed only to be returned
// from treediff?
}
δTKeyCov
.
ByRoot
[
root
]
=
δtkeycov
// XXX after rebuild
// XXX rebuild KVAtTail
// XXX rebuild lastRevOf
}
return
δB
,
δTKeyCov
,
nil
...
...
@@ -610,11 +619,6 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
}
// update brings .δBtail up to date by recomputing diff XXX and taking new
// entries in .δZtail into account.
// func (δBtail *ΔBtail) update() XXX kill
// Get returns root[key] as of @at database state plus revision that changed it.
//
// if revExact=False - rev is upper estimate for the revision.
...
...
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