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
8db3f96a
Commit
8db3f96a
authored
Sep 10, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X don't track embedded buckets
Reason: see comments. Prerequisite to fix test_wcfs_watch_2files
parent
74bf1db8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
wcfs/δbtail.go
wcfs/δbtail.go
+11
-4
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+3
-4
No files found.
wcfs/δbtail.go
View file @
8db3f96a
...
@@ -416,7 +416,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
...
@@ -416,7 +416,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
}
}
}
}
_
,
ok
:=
δBtail
.
byRoot
[
root
]
_
,
ok
:=
δBtail
.
byRoot
[
root
]
if
!
ok
{
if
!
ok
{
δBtail
.
byRoot
[
root
]
=
newΔTtail
()
δBtail
.
byRoot
[
root
]
=
newΔTtail
()
...
@@ -446,13 +445,21 @@ func (tidx trackIndex) AddPath(path []zodb.Oid) {
...
@@ -446,13 +445,21 @@ func (tidx trackIndex) AddPath(path []zodb.Oid) {
panic
(
"empty path"
)
panic
(
"empty path"
)
}
}
// don't explicitly keep track of embedded buckets - they all have
// InvalidOid, and thus, if kept in tidx, e.g. T/B1:a and another
// T/B2:b would lead to InvalidOid having multiple parents.
if
l
>=
2
&&
path
[
l
-
1
]
==
zodb
.
InvalidOid
{
path
=
path
[
:
l
-
1
]
}
parent
:=
zodb
.
InvalidOid
parent
:=
zodb
.
InvalidOid
var
ptrack
*
nodeTrack
=
nil
var
ptrack
*
nodeTrack
=
nil
var
track
*
nodeTrack
// XXX kill here
var
track
*
nodeTrack
// XXX kill here
var
oldTrack
bool
var
oldTrack
bool
for
_
,
oid
:=
range
path
{
for
_
,
oid
:=
range
path
{
// XXX skip InvalidOid ?
if
oid
==
zodb
.
InvalidOid
{
// InvalidOid means embedded bucket - e.g. T/B1:a with bucket not having its own oid.
panicf
(
"path has node with invalid oid: %v"
,
path
)
}
track
,
oldTrack
=
tidx
[
oid
]
track
,
oldTrack
=
tidx
[
oid
]
if
!
oldTrack
{
if
!
oldTrack
{
...
@@ -994,7 +1001,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx trackIndex, h
...
@@ -994,7 +1001,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx trackIndex, h
for
_
,
ac
:=
range
achildren
{
for
_
,
ac
:=
range
achildren
{
acOid
:=
ac
.
node
.
POid
()
acOid
:=
ac
.
node
.
POid
()
_
,
tracked
:=
trackIdx
[
acOid
]
_
,
tracked
:=
trackIdx
[
acOid
]
if
!
tracked
{
if
!
tracked
&&
/*cannot skip embedded bucket:*/
acOid
!=
zodb
.
InvalidOid
{
continue
continue
}
}
...
...
wcfs/δbtail_test.go
View file @
8db3f96a
...
@@ -339,11 +339,10 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) trackIndex {
...
@@ -339,11 +339,10 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) trackIndex {
trackIdx
:=
trackIndex
{}
trackIdx
:=
trackIndex
{}
for
k
:=
range
tracked
{
for
k
:=
range
tracked
{
kb
:=
rbs
.
Get
(
k
)
kb
:=
rbs
.
Get
(
k
)
// trackIdx records regular buckets or non-empty embedded bucket
// trackIdx explicitly records only regular buckets.
// ( empty embedded bucket means there is just empty tree node
// embedded buckets all have oid=zodb.InvalidOid and would lead to z
// and only that empty tree node is recorded in trackIdx )
newNode
:=
false
newNode
:=
false
if
(
kb
.
oid
!=
zodb
.
InvalidOid
||
len
(
kb
.
kv
)
!=
0
)
{
if
kb
.
oid
!=
zodb
.
InvalidOid
{
track
,
already
:=
trackIdx
[
kb
.
oid
]
track
,
already
:=
trackIdx
[
kb
.
oid
]
if
!
already
{
if
!
already
{
track
=
&
nodeTrack
{
parent
:
kb
.
parent
.
oid
,
nchild
:
0
}
track
=
&
nodeTrack
{
parent
:
kb
.
parent
.
oid
,
nchild
:
0
}
...
...
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