Commit 0dce582b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a00572f6
......@@ -20,8 +20,6 @@
package zodb
// cache management
//go:generate gotrace gen .
import (
"context"
"fmt"
......
......@@ -72,8 +72,8 @@ import (
"os"
"sync"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/xcommon/xbufio"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/xerr"
......
......@@ -74,7 +74,7 @@ func checkLoad(t *testing.T, fs *FileStorage, xid zodb.Xid, expect objState) {
URL: fs.URL(),
Op: "load",
Args: xid,
Err: &zodb.NoDataError{Oid: xid.Oid , DeletedAt: expect.tid},
Err: &zodb.NoDataError{Oid: xid.Oid, DeletedAt: expect.tid},
}
if !reflect.DeepEqual(err, errOk) {
t.Errorf("load %v: returned err unexpected: %v ; want: %v", xid, err, errOk)
......@@ -208,7 +208,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
}
for kdata := 0; ; kdata++ {
dataErrorf := func(format string, a...interface{}) {
dataErrorf := func(format string, a ...interface{}) {
t.Helper()
dsubj := fmt.Sprintf("dstep %v#%v", kdata, len(dbe.Entryv))
msg := fmt.Sprintf(format, a...)
......
......@@ -26,9 +26,9 @@ import (
"io"
"os"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/xcommon/xbufio"
"lab.nexedi.com/kirr/neo/go/xcommon/xio"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/xbytes"
......@@ -74,9 +74,9 @@ const (
// on-disk sizes
FileHeaderSize = 4
TxnHeaderFixSize = 8+8+1+2+2+2 // without user/desc/ext strings
TxnHeaderFixSize = 8 + 8 + 1 + 2 + 2 + 2 // without user/desc/ext strings
txnXHeaderFixSize = 8 + TxnHeaderFixSize // ^^^ with trail LenPrev from previous record
DataHeaderSize = 8+8+8+8+2+8
DataHeaderSize = 8 + 8 + 8 + 8 + 2 + 8
// txn/data pos that if < vvv are for sure invalid
txnValidFrom = FileHeaderSize
......@@ -291,7 +291,6 @@ func (txnh *TxnHeader) Load(r io.ReaderAt, pos int64, flags TxnLoadFlags) error
return checkErr(r, txnh, "invalid status: %q", txnh.Status)
}
luser := binary.BigEndian.Uint16(work[8+17:])
ldesc := binary.BigEndian.Uint16(work[8+19:])
lext := binary.BigEndian.Uint16(work[8+21:])
......@@ -473,8 +472,8 @@ func (dh *DataHeader) Load(r io.ReaderAt, pos int64) error {
}
// XXX also check oid.Valid() ?
dh.Oid = zodb.Oid(binary.BigEndian.Uint64(dh.workMem[0:])) // XXX -> zodb.Oid.Decode() ?
dh.Tid = zodb.Tid(binary.BigEndian.Uint64(dh.workMem[8:])) // XXX -> zodb.Tid.Decode() ?
dh.Oid = zodb.Oid(binary.BigEndian.Uint64(dh.workMem[0:]))
dh.Tid = zodb.Tid(binary.BigEndian.Uint64(dh.workMem[8:]))
if !dh.Tid.Valid() {
return checkErr(r, dh, "invalid tid: %v", dh.Tid)
}
......
......@@ -102,7 +102,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
err = it.NextTxn(fs1.LoadAll)
if err != nil {
if err == io.EOF {
err = nil // XXX -> okEOF(err)
err = nil
}
return err
}
......@@ -110,7 +110,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
err = d.DumpTxn(buf, it)
if err != nil {
if err == io.EOF {
err = nil // XXX -> okEOF(err)
err = nil
}
return err
}
......@@ -163,7 +163,7 @@ func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
err := it.NextData()
if err != nil {
if err == io.EOF {
err = nil // XXX -> okEOF(err)
err = nil
}
return err
}
......@@ -359,7 +359,7 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
_, err := it.R.ReadAt(d.data, txnh.DataPos())
if err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF // XXX -> noEOF(err)
err = io.ErrUnexpectedEOF
}
// XXX dup wrt fs1.TxnHeader.err
return &fs1.RecordError{xio.Name(it.R), "transaction record", txnh.Pos, "read data payload", err}
......
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// (from patched version available at https://lab.nexedi.com/kirr/b.git)
//
// KEY=zodb.Oid VALUE=int64
// ---- 8< ----
......
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// (from patched version available at https://lab.nexedi.com/kirr/b.git)
//
// ---- 8< ----
package fsb
......
......@@ -28,12 +28,24 @@ de=16 # KEY+VALUE
o=24 # d.c, d.n, d.p
kd=$(( (4096 - $o - $de) / (2 * $de) ))
# git_upstream_url <repo> - show current branch upstream URL
git_upstream_url() {
repo=$1
head="`git -C $repo symbolic-ref --short HEAD`" # current branch - e.g. "t"
remote="`git -C $repo config --get branch.$head.remote`" # upstream name, e.g. "kirr"
url="`git -C $repo config --get remote.$remote.url`" # upstream URL
echo "$url"
}
b=github.com/cznic/b
Bdir=`go list -f '{{.Dir}}' $b`
Brev=`cd $Bdir && git describe --always`
Brev=`git -C $Bdir describe --always`
Bweb=`git_upstream_url $Bdir`
out=fsbtree.go
echo "// Code generated by gen-fsbtree from $b $Brev; DO NOT EDIT." >$out
echo "// (from patched version available at $Bweb)" >>$out
echo "//" >>$out
echo "// KEY=$KEY VALUE=$VALUE" >>$out
echo "// ---- 8< ----" >>$out
echo >>$out
......@@ -56,6 +68,8 @@ make -s -C $Bdir generic |sed \
# also extract dump() routine
out=fsbtree_util.go
echo "// Code generated by gen-fsbtree from $b $Brev; DO NOT EDIT." >$out
echo "// (from patched version available at $Bweb)" >>$out
echo "//" >>$out
echo "// ---- 8< ----" >>$out
echo >>$out
cat >>$out <<EOF
......
......@@ -23,7 +23,6 @@ import (
"io"
)
// XXX -> xio ?
// noEOF returns err, but changes io.EOF -> io.ErrUnexpectedEOF
func noEOF(err error) error {
if err == io.EOF {
......
......@@ -239,8 +239,8 @@ type IStorageDriver interface {
// TODO: write mode
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) error
// StoreKeepCurrent(oid Oid, serial Tid, txn ITransaction)
// Store(ctx, oid Oid, serial Tid, data []byte, txn ITransaction) error
// StoreKeepCurrent(ctx, oid Oid, serial Tid, txn ITransaction)
// TpcBegin(txn)
// TpcVote(txn)
......
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