Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Stefane Fermigier
neo
Commits
fe8d33cd
Commit
fe8d33cd
authored
Nov 08, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
375efa1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
38 deletions
+6
-38
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+4
-37
go/zodb/storage/fs1/fs1tools/dump.go
go/zodb/storage/fs1/fs1tools/dump.go
+1
-1
go/zodb/zodb.go
go/zodb/zodb.go
+1
-0
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
fe8d33cd
...
...
@@ -146,6 +146,7 @@ func (fs *FileStorage) Load(_ context.Context, xid zodb.Xid) (buf *zodb.Buf, tid
}
// FIXME zodb.TidMax is only 7fff... tid from outside can be ffff...
// XXX go compiler cannot deduce dh should be on stack here
//dh := DataHeader{Oid: xid.Oid, Tid: zodb.TidMax, PrevRevPos: dataPos}
dh
:=
DataHeaderAlloc
()
...
...
@@ -264,7 +265,7 @@ func (zi *zIter) NextTxn(_ context.Context) (*zodb.TxnInfo, zodb.IDataIterator,
func
(
zi
*
zIter
)
NextData
(
_
context
.
Context
)
(
*
zodb
.
DataInfo
,
error
)
{
err
:=
zi
.
iter
.
NextData
()
if
err
!=
nil
{
return
nil
,
err
// XXX recheck
return
nil
,
err
}
zi
.
datai
.
Oid
=
zi
.
iter
.
Datah
.
Oid
...
...
@@ -279,7 +280,7 @@ func (zi *zIter) NextData(_ context.Context) (*zodb.DataInfo, error) {
}
zi
.
dataBuf
,
err
=
zi
.
dhLoading
.
LoadData
(
zi
.
iter
.
R
)
if
err
!=
nil
{
return
nil
,
err
// XXX recheck
return
nil
,
err
}
zi
.
datai
.
Data
=
zi
.
dataBuf
.
Data
...
...
@@ -318,7 +319,7 @@ func (fs *FileStorage) findTxnRecord(r io.ReaderAt, tid zodb.Tid) (TxnHeader, er
tmin
.
CloneFrom
(
&
fs
.
txnhMin
)
tmax
.
CloneFrom
(
&
fs
.
txnhMax
)
if
tmax
.
Pos
==
0
{
// XXX -> tmax.Valid()
)
?
if
tmax
.
Pos
==
0
{
// XXX -> tmax.Valid() ?
// empty database - no such record
return
TxnHeader
{},
nil
}
...
...
@@ -568,40 +569,6 @@ func (fs *FileStorage) saveIndex() (err error) {
return
nil
}
// indexCorruptError is the error returned when index verification fails.
//
// XXX but io errors during verification return not this
type
indexCorruptError
struct
{
index
*
Index
indexOk
*
Index
}
func
(
e
*
indexCorruptError
)
Error
()
string
{
// TODO show delta ?
return
"index corrupt"
}
// VerifyIndex verifies that index is correct
//
// XXX -> not exported @ fs1
func
(
fs
*
FileStorage
)
verifyIndex
(
ctx
context
.
Context
)
error
{
// XXX lock appends?
// XXX if .index is not yet loaded - load it
indexOk
,
err
:=
fs
.
computeIndex
(
ctx
)
if
err
!=
nil
{
return
err
// XXX err ctx
}
if
!
indexOk
.
Equal
(
fs
.
index
)
{
err
=
&
indexCorruptError
{
index
:
fs
.
index
,
indexOk
:
indexOk
}
}
return
err
}
// Reindex rebuilds the index
//
// XXX -> not exported @ fs1
...
...
go/zodb/storage/fs1/fs1tools/dump.go
View file @
fe8d33cd
...
...
@@ -375,7 +375,7 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
// https://github.com/zopefoundation/ZODB/blob/5.2.0-5-g6047e2fae/src/ZODB/scripts/fstail.py#L39
buf
.
S
(
"
\n
user="
)
.
Qpyb
(
txnh
.
User
)
.
S
(
" description="
)
.
Qpyb
(
txnh
.
Description
)
//
XXX in zodb/py .length is len - 8, in zodb/go - whole txn record length -> FIXME better .Len be what is on disk
//
NOTE at runtime: in zodb/py .length is len - 8, in zodb/go - whole txn record length
buf
.
S
(
" length="
)
.
D64
(
txnh
.
Len
-
8
)
buf
.
S
(
" offset="
)
.
D64
(
txnh
.
Pos
)
.
S
(
" (+"
)
.
D64
(
txnh
.
HeaderLen
())
.
S
(
")
\n\n
"
)
...
...
go/zodb/zodb.go
View file @
fe8d33cd
...
...
@@ -78,6 +78,7 @@ type DataInfo struct {
// original tid data was committed at (e.g. in case of undo)
//
// FIXME we don't really need this and this unnecessarily constraints interfaces.
// originates from: https://github.com/zopefoundation/ZODB/commit/2b0c9aa4
DataTid
Tid
}
...
...
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