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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
113c3f7d
Commit
113c3f7d
authored
Sep 12, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f2eb6a5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+5
-5
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+6
-1
go/zodb/storage/fs1/format.go
go/zodb/storage/fs1/format.go
+1
-1
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
113c3f7d
...
...
@@ -238,7 +238,7 @@ func (dh *DataHeader) Free() {
dhPool
.
Put
(
dh
)
}
func
(
fs
*
FileStorage
)
Load
(
_
context
.
Context
,
xid
zodb
.
Xid
)
(
data
*
zodb
.
Buf
,
tid
zodb
.
Tid
,
err
error
)
{
func
(
fs
*
FileStorage
)
Load
(
_
context
.
Context
,
xid
zodb
.
Xid
)
(
buf
*
zodb
.
Buf
,
tid
zodb
.
Tid
,
err
error
)
{
// lookup in index position of oid data record within latest transaction who changed this oid
dataPos
,
ok
:=
fs
.
index
.
Get
(
xid
.
Oid
)
if
!
ok
{
...
...
@@ -283,17 +283,17 @@ func (fs *FileStorage) Load(_ context.Context, xid zodb.Xid) (data *zodb.Buf, ti
// be of first-found transaction
tid
=
dh
.
Tid
data
,
err
=
dh
.
LoadData
(
fs
.
file
)
buf
,
err
=
dh
.
LoadData
(
fs
.
file
)
if
err
!=
nil
{
return
nil
,
0
,
&
ErrXidLoad
{
xid
,
err
}
}
if
d
ata
==
nil
{
if
buf
.
D
ata
==
nil
{
// data was deleted
// XXX or allow this and return via
d
ata=nil ?
// XXX or allow this and return via
buf.D
ata=nil ?
return
nil
,
0
,
&
zodb
.
ErrXidMissing
{
Xid
:
xid
}
}
return
data
,
tid
,
nil
return
buf
,
tid
,
nil
}
// --- ZODB-level iteration ---
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
113c3f7d
...
...
@@ -82,7 +82,12 @@ func checkLoad(t *testing.T, fs *FileStorage, xid zodb.Xid, expect oidLoadedOk)
if
tid
!=
expect
.
tid
{
t
.
Errorf
(
"load %v: returned tid unexpected: %v ; want: %v"
,
xid
,
tid
,
expect
.
tid
)
}
if
!
reflect
.
DeepEqual
(
buf
.
Data
,
expect
.
data
)
{
// NOTE reflect to catch nil != ""
switch
{
case
buf
==
nil
:
t
.
Errorf
(
"load %v: returned buf = nil"
,
xid
)
case
!
reflect
.
DeepEqual
(
buf
.
Data
,
expect
.
data
)
:
// NOTE reflect to catch nil != ""
t
.
Errorf
(
"load %v: different data:
\n
have: %q
\n
want: %q"
,
xid
,
buf
.
Data
,
expect
.
data
)
}
}
...
...
go/zodb/storage/fs1/format.go
View file @
113c3f7d
...
...
@@ -675,7 +675,7 @@ func (dh *DataHeader) LoadData(r io.ReaderAt) (*zodb.Buf, error) {
err
:=
dh
.
LoadBack
(
r
)
if
err
!=
nil
{
if
err
==
io
.
EOF
{
return
nil
,
nil
// deleted
return
&
zodb
.
Buf
{
Data
:
nil
}
,
nil
// deleted
}
return
nil
,
err
// XXX recheck
}
...
...
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