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
3ab0c05c
Commit
3ab0c05c
authored
May 14, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
52972b18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
wcfs/δbtail.go
wcfs/δbtail.go
+30
-10
No files found.
wcfs/δbtail.go
View file @
3ab0c05c
...
...
@@ -375,6 +375,11 @@ func (A trackIndex) DifferenceInplace(B trackIndex) {
}
func
(
A
trackIndex
)
xDifferenceInplace
(
B
trackIndex
,
δnchild
map
[
zodb
.
Oid
]
int
)
{
fmt
.
Printf
(
"
\n\n
xDifferenceInplace:
\n
"
)
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
defer
fmt
.
Printf
(
" ->d: %s
\n
"
,
A
)
// remove B.leafs and thier parents
for
oid
,
t2
:=
range
B
{
if
t2
.
nchild
!=
0
{
...
...
@@ -386,7 +391,14 @@ func (A trackIndex) xDifferenceInplace(B trackIndex, δnchild map[zodb.Oid]int)
continue
// already not there
}
// XXX assert t.parent == t2.parent ?
if
t2
.
parent
!=
t
.
parent
{
// XXX or verify this at Track time and require
// that update is passed only entries with the
// same .parent? (then it would be ok to panic here)
// XXX -> error (e.g. due to corrupt data in ZODB)
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
t
.
parent
,
t2
.
parent
)
}
delete
(
A
,
oid
)
if
t
.
parent
!=
zodb
.
InvalidOid
{
...
...
@@ -396,21 +408,29 @@ func (A trackIndex) xDifferenceInplace(B trackIndex, δnchild map[zodb.Oid]int)
}
func
(
A
trackIndex
)
xUnionInplace
(
B
trackIndex
,
δnchild
map
[
zodb
.
Oid
]
int
)
{
// process additions
fmt
.
Printf
(
"
\n\n
xUnionInplace:
\n
"
)
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
defer
fmt
.
Printf
(
" ->u: %s
\n
"
,
A
)
for
oid
,
t2
:=
range
B
{
t
,
already
:=
A
[
oid
]
if
already
{
if
!
already
{
t
=
&
nodeTrack
{
parent
:
t2
.
parent
,
nchild
:
0
}
A
[
oid
]
=
t
// remeber to nchild++ in parent
if
t
.
parent
!=
zodb
.
InvalidOid
{
δnchild
[
t
.
parent
]
-=
1
t
.
parent
=
t2
.
parent
δnchild
[
t
.
parent
]
+=
1
}
}
else
{
t
=
&
nodeTrack
{
parent
:
t2
.
parent
,
nchild
:
0
}
A
[
oid
]
=
t
if
t2
.
parent
!=
t
.
parent
{
// XXX or verify this at Track time and require
// that update is passed only entries with the
// same .parent? (then it would be ok to panic here)
// XXX -> error (e.g. due to corrupt data in ZODB)
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
t
.
parent
,
t2
.
parent
)
}
if
t
.
parent
!=
zodb
.
InvalidOid
{
δnchild
[
t
.
parent
]
+=
1
// remeber to nchild++ in parent
}
}
}
...
...
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