Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
e61e6494
Commit
e61e6494
authored
Mar 16, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
62af029d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
go/zodb/storage/demo/demo.go
go/zodb/storage/demo/demo.go
+9
-2
go/zodb/storage/demo/demo_test.go
go/zodb/storage/demo/demo_test.go
+1
-1
No files found.
go/zodb/storage/demo/demo.go
View file @
e61e6494
...
...
@@ -90,6 +90,7 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
}
useBase
:=
false
inδ
:=
false
var
eNoData
*
zodb
.
NoDataError
var
eNoObject
*
zodb
.
NoObjectError
switch
{
...
...
@@ -98,8 +99,9 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
// object deleted in δ -> whiteout
return
data
,
serial
,
eNoData
}
else
{
// object
not created in δ
// object
present in δ but not yet created as of xid.at
useBase
=
true
inδ
=
true
}
case
errors
.
As
(
err
,
&
eNoObject
)
:
...
...
@@ -121,7 +123,12 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
case
errors
.
As
(
err
,
&
eNoData
)
:
err
=
eNoData
case
errors
.
As
(
err
,
&
eNoObject
)
:
if
!
inδ
{
err
=
eNoObject
}
else
{
// object is present in δ
err
=
&
zodb
.
NoDataError
{
Oid
:
xid
.
Oid
,
DeletedAt
:
0
}
}
}
return
data
,
serial
,
err
...
...
go/zodb/storage/demo/demo_test.go
View file @
e61e6494
...
...
@@ -102,7 +102,7 @@ func withDemoData(t *testing.T, f func(t *testing.T, ddat *DemoData), optv ...tO
// verify on all combinations of preload being split into base+δ
work
:=
xtempdir
(
t
)
//
defer os.RemoveAll(work)
defer
os
.
RemoveAll
(
work
)
test1
:=
func
(
δstart
zodb
.
Tid
,
zdumpBase
,
zdumpδ
string
)
{
t
.
Helper
()
t
.
Run
(
fmt
.
Sprintf
(
"δstart=%s"
,
δstart
),
func
(
t
*
testing
.
T
)
{
...
...
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