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
c0b7e4c3
Commit
c0b7e4c3
authored
Aug 06, 2021
by
Kirill Smelkov
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X ΔFtail.SliceByFileRev: Fix untracked entries to be present uniformly in result
parent
20f924d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
10 deletions
+59
-10
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+44
-1
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+15
-9
No files found.
wcfs/internal/zdata/δftail.go
View file @
c0b7e4c3
...
@@ -646,6 +646,49 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -646,6 +646,49 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
ZinblkAt
=
epoch
ZinblkAt
=
epoch
}
}
// merge cumulative vδT(epoch,head] update to Zinblk, so that
// changes to blocks that were not explicitly requested to be
// tracked, are present in resulting slice uniformly.
//
// For example on
//
// at1 T/B0:a,1:b,2:c δDø δ{0,1,2}
// at2 δT{0:d,1:e} δD{c} δ{0,1,2}
// at3 δTø δD{c,d,e} δ{0,1,2}
// at4 δTø δD{c,e} δ{ 1,2}
//
// if tracked={0} for (at1,at4] query changes to 1 should be
// also all present @at2, @at3 and @at4 - because @at2 both 0
// and 1 are changed in the same tracked bucket. Note that
// changes to 2 should not be present at all.
ZinblkAdj
:=
map
[
zodb
.
Oid
]
setI64
{}
for
_
,
δT
:=
range
vδT
{
for
blk
,
δzblk
:=
range
δT
.
ΔKV
{
if
δzblk
.
Old
!=
xbtree
.
VDEL
{
inblk
,
ok
:=
ZinblkAdj
[
δzblk
.
Old
]
if
ok
{
inblk
.
Del
(
blk
)
}
}
if
δzblk
.
New
!=
xbtree
.
VDEL
{
inblk
,
ok
:=
ZinblkAdj
[
δzblk
.
New
]
if
!
ok
{
inblk
=
setI64
{}
ZinblkAdj
[
δzblk
.
New
]
=
inblk
}
inblk
.
Add
(
blk
)
}
}
}
for
zblk
,
inblkAdj
:=
range
ZinblkAdj
{
inblk
,
ok
:=
Zinblk
[
zblk
]
if
!
ok
{
Zinblk
[
zblk
]
=
inblkAdj
}
else
{
inblk
.
Update
(
inblkAdj
)
}
}
// merge vδZ and vδT of current epoch
// merge vδZ and vδT of current epoch
for
((
iz
>=
0
&&
vδZ
[
iz
]
.
Rev
>
epoch
)
||
it
>=
0
)
{
for
((
iz
>=
0
&&
vδZ
[
iz
]
.
Rev
>
epoch
)
||
it
>=
0
)
{
// δZ that is covered by current Zinblk
// δZ that is covered by current Zinblk
...
@@ -675,7 +718,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -675,7 +718,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
if
δzblk
.
New
!=
xbtree
.
VDEL
{
if
δzblk
.
New
!=
xbtree
.
VDEL
{
inblk
,
ok
:=
Zinblk
[
δzblk
.
New
]
inblk
,
ok
:=
Zinblk
[
δzblk
.
New
]
if
ok
{
if
ok
{
inblk
.
Del
(
blk
)
// FIXME have to recheck vδZ for later entries of δzblk.New
inblk
.
Del
(
blk
)
}
}
}
}
if
δzblk
.
Old
!=
xbtree
.
VDEL
{
if
δzblk
.
Old
!=
xbtree
.
VDEL
{
...
...
wcfs/internal/zdata/δftail_test.go
View file @
c0b7e4c3
...
@@ -702,30 +702,36 @@ func TestΔFtailSliceUntrackedUniform(t_ *testing.T) {
...
@@ -702,30 +702,36 @@ func TestΔFtailSliceUntrackedUniform(t_ *testing.T) {
// blktab[2] remains unnoticed because it is not changed past at1.
// blktab[2] remains unnoticed because it is not changed past at1.
xtrackBlk
(
0
)
xtrackBlk
(
0
)
// (at1, at4] -> changes to both 0 and 1, because they both are changed in the same bucket @at2
// (at1, at4]
lo
:=
t1
.
At
lo
:=
t1
.
At
hi
:=
t4
.
At
hi
:=
t4
.
At
vδf
:=
δFtail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf
:=
δFtail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf_ok
:=
[]
*
ΔFile
{
vδf_ok
:=
[]
*
ΔFile
{
&
ΔFile
{
Rev
:
t2
.
At
,
Blocks
:
b
(
0
,
1
),
Size
:
true
},
&
ΔFile
{
Rev
:
t2
.
At
,
Blocks
:
b
(
0
,
1
),
Size
:
true
},
&
ΔFile
{
Rev
:
t3
.
At
,
Blocks
:
b
(
0
,
1
),
Size
:
false
},
&
ΔFile
{
Rev
:
t3
.
At
,
Blocks
:
b
(
0
,
1
),
Size
:
false
},
&
ΔFile
{
Rev
:
t4
.
At
,
Blocks
:
b
(
1
),
Size
:
false
},
&
ΔFile
{
Rev
:
t4
.
At
,
Blocks
:
b
(
1
),
Size
:
false
},
}
}
if
!
reflect
.
DeepEqual
(
vδf
,
vδf_ok
)
{
if
!
reflect
.
DeepEqual
(
vδf
,
vδf_ok
)
{
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
vδfstr
(
vδf
),
vδfstr
(
vδf_ok
))
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
vδfstr
(
vδf
),
vδfstr
(
vδf_ok
))
}
}
return
// (at2, at4] -> changes to only 0, because there is no change to 2 via blktab
// XXX vvv correct
// (at2, at4]
lo
=
t2
.
At
lo
=
t2
.
At
vδf
=
δFtail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf
=
δFtail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf_ok
=
[]
*
ΔFile
{
vδf_ok
=
[]
*
ΔFile
{
&
ΔFile
{
Rev
:
t3
.
At
,
Blocks
:
b
(
0
,
1
),
Size
:
false
},
&
ΔFile
{
Rev
:
t3
.
At
,
Blocks
:
b
(
0
),
Size
:
false
},
&
ΔFile
{
Rev
:
t4
.
At
,
Blocks
:
b
(
1
),
Size
:
false
},
}
if
!
reflect
.
DeepEqual
(
vδf
,
vδf_ok
)
{
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
vδfstr
(
vδf
),
vδfstr
(
vδf_ok
))
}
// (at3, at4] -> changes to only 0, ----/----
lo
=
t3
.
At
vδf
=
δFtail
.
SliceByFileRev
(
zfile
,
lo
,
hi
)
vδf_ok
=
[]
*
ΔFile
(
nil
)
if
!
reflect
.
DeepEqual
(
vδf
,
vδf_ok
)
{
t
.
Errorf
(
"slice (@%s,@%s]:
\n
have: %v
\n
want: %v"
,
xat
[
lo
],
xat
[
hi
],
vδfstr
(
vδf
),
vδfstr
(
vδf_ok
))
}
}
}
}
...
...
Kirill Smelkov
@kirr
mentioned in commit
23d8da82
·
Oct 27, 2021
mentioned in commit
23d8da82
mentioned in commit 23d8da82b89134b00ae8dafeb0a5c7348dd8b4fe
Toggle commit list
Kirill Smelkov
@kirr
mentioned in commit
f980471f
·
Oct 28, 2021
mentioned in commit
f980471f
mentioned in commit f980471f6bd466f7da6fbe6753a7a14b1d3c8151
Toggle commit list
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