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
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
3d3017c5
Commit
3d3017c5
authored
Jul 26, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1cb9bf49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+1
-0
go/zodb/storage/fs1/fs1tools/dump.go
go/zodb/storage/fs1/fs1tools/dump.go
+22
-11
go/zodb/storage/fs1/fs1tools/reindex.go
go/zodb/storage/fs1/fs1tools/reindex.go
+1
-1
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
3d3017c5
...
...
@@ -599,6 +599,7 @@ func (dh *DataHeader) loadPrevRev(r io.ReaderAt) error {
// LoadBackRef reads data for the data record and decodes it as backpointer reference.
// prerequisite: dh loaded and .LenData == 0 (data record with back-pointer)
// XXX return backPos=-1 if err?
// XXX unused?
func
(
dh
*
DataHeader
)
LoadBackRef
(
r
io
.
ReaderAt
)
(
backPos
int64
,
err
error
)
{
if
dh
.
DataLen
!=
0
{
bug
(
dh
,
"LoadBack() on non-backpointer data header"
)
...
...
go/zodb/storage/fs1/fs1tools/dump.go
View file @
3d3017c5
...
...
@@ -129,6 +129,10 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
// https://github.com/zopefoundation/ZODB/commit/ddcb46a2
type
DumperFsDump
struct
{
ntxn
int
// current transaction record #
// for loading data
dhLoading
fs1
.
DataHeader
data
[]
byte
}
func
(
d
*
DumperFsDump
)
DumperName
()
string
{
...
...
@@ -164,19 +168,21 @@ func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
buf
.
S
(
fmt
.
Sprintf
(
"%05d"
,
j
))
// XXX -> .D_f("05", j)
buf
.
S
(
" oid="
)
.
V
(
dh
.
Oid
)
if
dh
.
DataLen
==
0
{
buf
.
S
(
" class=undo or abort of object creation"
)
backPos
,
err
:=
dh
.
LoadBackRef
(
it
.
R
)
if
err
!=
nil
{
// XXX
}
// load actual data
d
.
dhLoading
=
*
dh
data
:=
d
.
data
err
=
d
.
dhLoading
.
LoadData
(
it
.
R
,
&
data
)
if
err
!=
nil
{
return
err
}
// if memory was reallocated - use it next time
if
cap
(
data
)
>
cap
(
d
.
data
)
{
d
.
data
=
data
}
if
backPos
!=
0
{
buf
.
S
(
" bp="
)
.
X016
(
uint64
(
backPos
))
}
if
data
==
nil
{
buf
.
S
(
" class=undo or abort of object creation"
)
}
else
{
// XXX Datah.LoadData()
//modname, classname = zodb.GetPickleMetadata(...) // XXX
//fullclass = "%s.%s" % (modname, classname)
fullclass
:=
"AAA.BBB"
// FIXME stub
...
...
@@ -185,6 +191,11 @@ func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
buf
.
S
(
" class="
)
.
S
(
fullclass
)
}
if
dh
.
DataLen
==
0
&&
data
!=
nil
{
// it was backpointer - print tid of transaction it points to
buf
.
S
(
" bp="
)
.
V
(
d
.
dhLoading
.
Tid
)
}
buf
.
S
(
"
\n
"
)
}
...
...
go/zodb/storage/fs1/fs1tools/reindex.go
View file @
3d3017c5
...
...
@@ -60,7 +60,7 @@ func VerifyIndexFor(path string) error {
// ----------------------------------------
const
reindexSummary
=
"
dump last few transactions of a database"
const
reindexSummary
=
"
XXX"
// XXX
func
reindexUsage
(
w
io
.
Writer
)
{
fmt
.
Fprintf
(
w
,
...
...
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