Commit 375efa1e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f44b8da3
...@@ -124,14 +124,13 @@ func (e *ErrXidLoad) Error() string { ...@@ -124,14 +124,13 @@ func (e *ErrXidLoad) Error() string {
} }
// freelist(DataHeader) XXX move -> format.go ? // freelist(DataHeader)
var dhPool = sync.Pool{New: func() interface{} { return &DataHeader{} }} var dhPool = sync.Pool{New: func() interface{} { return &DataHeader{} }}
// DataHeaderAlloc allocates DataHeader from freelist. // DataHeaderAlloc allocates DataHeader from freelist.
func DataHeaderAlloc() *DataHeader { func DataHeaderAlloc() *DataHeader {
return dhPool.Get().(*DataHeader) return dhPool.Get().(*DataHeader)
} }
// Free puts dh back into DataHeader freelist. // Free puts dh back into DataHeader freelist.
// //
// Caller must not use dh after call to Free. // Caller must not use dh after call to Free.
......
This diff is collapsed.
...@@ -29,6 +29,7 @@ import ( ...@@ -29,6 +29,7 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb" "lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/storage/fs1" "lab.nexedi.com/kirr/neo/go/zodb/storage/fs1"
"lab.nexedi.com/kirr/neo/go/xcommon/xio"
"lab.nexedi.com/kirr/go123/prog" "lab.nexedi.com/kirr/go123/prog"
"lab.nexedi.com/kirr/go123/xbytes" "lab.nexedi.com/kirr/go123/xbytes"
...@@ -362,7 +363,8 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error { ...@@ -362,7 +363,8 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
if err == io.EOF { if err == io.EOF {
err = io.ErrUnexpectedEOF // XXX -> noEOF(err) err = io.ErrUnexpectedEOF // XXX -> noEOF(err)
} }
return &fs1.TxnError{txnh.Pos, "read data payload", err} // XXX dup wrt fs1.TxnHeader.err
return &fs1.RecordError{xio.Name(it.R), "transaction record", txnh.Pos, "read data payload", err}
} }
// print information about read txn record // print information about read txn record
......
...@@ -62,12 +62,13 @@ def main(): ...@@ -62,12 +62,13 @@ def main():
txnLenPrev = -1 txnLenPrev = -1
for txn in stor.iterator(): # txn is TransactionRecord for txn in stor.iterator(): # txn is TransactionRecord
# txn.extension is already depickled dict - we want to put raw data from file # txn.extension is already depickled dict - we want to put raw data from file
# also we need to access txn record legth which is not provided by higher-level iterator # also we need to access txn record length which is not provided by higher-level iterator
# do deep-dive into FileStorage # do deep-dive into FileStorage
th = stor._read_txn_header(txn._tpos) th = stor._read_txn_header(txn._tpos)
assert th.tid == txn.tid assert th.tid == txn.tid
assert th.tlen == txn._tend - txn._tpos assert th.tlen == txn._tend - txn._tpos
# fs1/go keeps in RAM whole txn length, not len-8 as it is on disk
txnLen = th.tlen + 8 txnLen = th.tlen + 8
emit("\t{") emit("\t{")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment