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
e29f32d0
Commit
e29f32d0
authored
Sep 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
811f8864
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
wcfs/δbtail.go
wcfs/δbtail.go
+12
-0
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+16
-16
No files found.
wcfs/δbtail.go
View file @
e29f32d0
...
...
@@ -667,6 +667,18 @@ func treediff(ctx context.Context, root zodb.Oid, δtops SetOid, δZTC SetOid, t
}
}
// adjust holeIdx
for
k
,
δv
:=
range
δT
{
if
δv
.
Old
==
VDEL
{
holeIdx
.
Del
(
k
)
}
if
δv
.
New
==
VDEL
{
holeIdx
.
Add
(
k
)
}
}
// XXX adjust trackIdx
return
δT
,
nil
}
...
...
wcfs/δbtail_test.go
View file @
e29f32d0
...
...
@@ -494,7 +494,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
}
}
adj
:=
SetKey
{};
adj
.
Update
(
adj1
);
adj
.
Update
(
adj2
)
adj
:=
SetKey
{};
adj
.
Add
(
k
);
adj
.
Update
(
adj1
);
adj
.
Update
(
adj2
)
kadj
[
k
]
=
adj
}
...
...
@@ -621,11 +621,11 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
holes2
.
Add
(
k
)
}
}
/* XXX reenable
/
//
* XXX reenable
if
!
reflect
.
DeepEqual
(
holes2
,
δbtail
.
holeIdx
.
SetKey
)
{
badf
(
"δbtail.holeIdx2 wrong ; holeIdx=%v holeIdxOK=%v"
,
δbtail
.
holeIdx
,
holes2
)
}
*/
//
*/
// XXX verify δbtail index consistency against @at2
// XXX verify that removed keys remain in trackedIdx (holes), so that e.g.
...
...
@@ -813,7 +813,7 @@ func TestΔBTail(t *testing.T) {
A
{
1
:
K
(
1
),
3
:
K
(
3
),
99
:
K
(
3
,
99
),
oo
:
K
(
3
,
99
)}),
oo
:
K
(
3
,
99
,
oo
)}),
// XXX --------
// tree rotation
...
...
@@ -827,37 +827,37 @@ func TestΔBTail(t *testing.T) {
// +1
Δ
(
"T/B1:a"
,
A
{
1
:
K
(
1
),
oo
:
K
(
1
)}),
oo
:
K
(
1
,
oo
)}),
// +2
Δ
(
"T/B1:a,2:b"
,
A
{
1
:
K
(
1
,
2
),
2
:
K
(
1
,
2
),
oo
:
K
(
1
,
2
)}),
oo
:
K
(
1
,
2
,
oo
)}),
// -1
Δ
(
"T/B2:b"
,
A
{
1
:
K
(
1
,
2
),
2
:
K
(
1
,
2
),
oo
:
K
(
1
,
2
)}),
oo
:
K
(
1
,
2
,
oo
)}),
// 2: b->c
Δ
(
"T/B2:c"
,
A
{
2
:
K
(
2
),
oo
:
K
(
2
)}),
oo
:
K
(
2
,
oo
)}),
// +1 in new bucket (to the left)
Δ
(
"T2/B1:a-B2:c"
,
A
{
1
:
K
(
1
,
2
),
2
:
K
(
2
),
oo
:
K
(
2
)}),
// NOTE no ∞ -> 1, because 1 is added to the left
oo
:
K
(
2
,
oo
)}),
// NOTE no ∞ -> 1, because 1 is added to the left
// +3 in new bucket (to the right)
Δ
(
"T2,3/B1:a-B2:c-B3:c"
,
A
{
1
:
K
(
1
),
2
:
K
(
2
),
3
:
K
(
2
,
3
),
oo
:
K
(
2
,
3
)}),
oo
:
K
(
2
,
3
,
oo
)}),
// bucket split; +3 in new bucket
"T/B1:a,2:b"
,
...
...
@@ -865,7 +865,7 @@ func TestΔBTail(t *testing.T) {
A
{
1
:
K
(
1
,
2
,
3
),
2
:
K
(
1
,
2
,
3
),
3
:
K
(
1
,
2
,
3
),
oo
:
K
(
1
,
2
,
3
)}),
oo
:
K
(
1
,
2
,
3
,
oo
)}),
// bucket split; +3 in new bucket; +4 +5 in another new bucket
// which remain not tracked unless previously accessed.
...
...
@@ -876,7 +876,7 @@ func TestΔBTail(t *testing.T) {
3
:
K
(
1
,
2
,
3
),
4
:
K
(
1
,
2
,
3
,
4
,
5
),
5
:
K
(
1
,
2
,
3
,
4
,
5
),
oo
:
K
(
1
,
2
,
3
,
4
,
5
)}),
oo
:
K
(
1
,
2
,
3
,
4
,
5
,
oo
)}),
// reflow of keys: even if tracked={1}, changes to all B nodes need to be rescanned:
// +B12 forces to look in -B23 which adds -3 into δ, which
...
...
@@ -890,7 +890,7 @@ func TestΔBTail(t *testing.T) {
5
:
K
(
1
,
2
,
3
,
4
,
5
,
6
,
7
),
6
:
K
(
1
,
2
,
3
,
4
,
5
,
6
,
7
),
7
:
K
(
1
,
2
,
3
,
4
,
5
,
6
,
7
),
oo
:
K
(
1
,
2
,
3
,
4
,
5
,
6
,
7
)}),
oo
:
K
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
oo
)}),
// depth=2; bucket split; +3 in new bucket; left T remain
// _unchanged_ even though B under it is modified; right arm is
...
...
@@ -900,7 +900,7 @@ func TestΔBTail(t *testing.T) {
A
{
1
:
K
(
1
,
2
,
3
),
2
:
K
(
1
,
2
,
3
),
3
:
K
(
1
,
2
,
3
),
oo
:
K
(
1
,
2
,
3
)}),
oo
:
K
(
1
,
2
,
3
,
oo
)}),
// depth=2; like prev. case, but additional right arm with +4
// +5 is added which remain not tracked unless previously accessed.
...
...
@@ -911,7 +911,7 @@ func TestΔBTail(t *testing.T) {
3
:
K
(
1
,
2
,
3
),
4
:
K
(
1
,
2
,
3
,
4
,
5
),
5
:
K
(
1
,
2
,
3
,
4
,
5
),
oo
:
K
(
1
,
2
,
3
,
4
,
5
)}),
oo
:
K
(
1
,
2
,
3
,
4
,
5
,
oo
)}),
// depth=2; bucket split; +3 in new bucket; t0 and t1 split;
// +right arm (T7/B45-B89) which remain not tracked unless previously accessed.
...
...
@@ -924,7 +924,7 @@ func TestΔBTail(t *testing.T) {
5
:
K
(
1
,
2
,
3
,
4
,
5
),
8
:
K
(
1
,
2
,
3
,
8
,
9
),
9
:
K
(
1
,
2
,
3
,
8
,
9
),
oo
:
K
(
1
,
2
,
3
,
8
,
9
)}),
oo
:
K
(
1
,
2
,
3
,
8
,
9
,
oo
)}),
// 2 reflow to right B neighbour; 8 split into new B; δ=ø
...
...
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