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
0dce582b
Commit
0dce582b
authored
Jan 11, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a00572f6
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
101 additions
and
87 deletions
+101
-87
go/zodb/cache.go
go/zodb/cache.go
+0
-2
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+16
-16
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+13
-13
go/zodb/storage/fs1/format.go
go/zodb/storage/fs1/format.go
+47
-48
go/zodb/storage/fs1/fs1tools/dump.go
go/zodb/storage/fs1/fs1tools/dump.go
+4
-4
go/zodb/storage/fs1/fsb/fsbtree.go
go/zodb/storage/fs1/fsb/fsbtree.go
+2
-0
go/zodb/storage/fs1/fsb/fsbtree_util.go
go/zodb/storage/fs1/fsb/fsbtree_util.go
+2
-0
go/zodb/storage/fs1/fsb/gen-fsbtree
go/zodb/storage/fs1/fsb/gen-fsbtree
+15
-1
go/zodb/storage/fs1/util.go
go/zodb/storage/fs1/util.go
+0
-1
go/zodb/zodb.go
go/zodb/zodb.go
+2
-2
No files found.
go/zodb/cache.go
View file @
0dce582b
...
@@ -20,8 +20,6 @@
...
@@ -20,8 +20,6 @@
package
zodb
package
zodb
// cache management
// cache management
//go:generate gotrace gen .
import
(
import
(
"context"
"context"
"fmt"
"fmt"
...
...
go/zodb/storage/fs1/filestorage.go
View file @
0dce582b
...
@@ -72,8 +72,8 @@ import (
...
@@ -72,8 +72,8 @@ import (
"os"
"os"
"sync"
"sync"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/xcommon/xbufio"
"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/mem"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xerr"
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
0dce582b
...
@@ -74,7 +74,7 @@ func checkLoad(t *testing.T, fs *FileStorage, xid zodb.Xid, expect objState) {
...
@@ -74,7 +74,7 @@ func checkLoad(t *testing.T, fs *FileStorage, xid zodb.Xid, expect objState) {
URL
:
fs
.
URL
(),
URL
:
fs
.
URL
(),
Op
:
"load"
,
Op
:
"load"
,
Args
:
xid
,
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
)
{
if
!
reflect
.
DeepEqual
(
err
,
errOk
)
{
t
.
Errorf
(
"load %v: returned err unexpected: %v ; want: %v"
,
xid
,
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
...
@@ -208,7 +208,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
}
}
for
kdata
:=
0
;
;
kdata
++
{
for
kdata
:=
0
;
;
kdata
++
{
dataErrorf
:=
func
(
format
string
,
a
...
interface
{})
{
dataErrorf
:=
func
(
format
string
,
a
...
interface
{})
{
t
.
Helper
()
t
.
Helper
()
dsubj
:=
fmt
.
Sprintf
(
"dstep %v#%v"
,
kdata
,
len
(
dbe
.
Entryv
))
dsubj
:=
fmt
.
Sprintf
(
"dstep %v#%v"
,
kdata
,
len
(
dbe
.
Entryv
))
msg
:=
fmt
.
Sprintf
(
format
,
a
...
)
msg
:=
fmt
.
Sprintf
(
format
,
a
...
)
...
...
go/zodb/storage/fs1/format.go
View file @
0dce582b
...
@@ -26,9 +26,9 @@ import (
...
@@ -26,9 +26,9 @@ import (
"io"
"io"
"os"
"os"
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/xcommon/xbufio"
"lab.nexedi.com/kirr/neo/go/xcommon/xbufio"
"lab.nexedi.com/kirr/neo/go/xcommon/xio"
"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/mem"
"lab.nexedi.com/kirr/go123/xbytes"
"lab.nexedi.com/kirr/go123/xbytes"
...
@@ -74,9 +74,9 @@ const (
...
@@ -74,9 +74,9 @@ const (
// on-disk sizes
// on-disk sizes
FileHeaderSize
=
4
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
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
// txn/data pos that if < vvv are for sure invalid
txnValidFrom
=
FileHeaderSize
txnValidFrom
=
FileHeaderSize
...
@@ -291,7 +291,6 @@ func (txnh *TxnHeader) Load(r io.ReaderAt, pos int64, flags TxnLoadFlags) error
...
@@ -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
)
return
checkErr
(
r
,
txnh
,
"invalid status: %q"
,
txnh
.
Status
)
}
}
luser
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
17
:
])
luser
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
17
:
])
ldesc
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
19
:
])
ldesc
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
19
:
])
lext
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
21
:
])
lext
:=
binary
.
BigEndian
.
Uint16
(
work
[
8
+
21
:
])
...
@@ -473,8 +472,8 @@ func (dh *DataHeader) Load(r io.ReaderAt, pos int64) error {
...
@@ -473,8 +472,8 @@ func (dh *DataHeader) Load(r io.ReaderAt, pos int64) error {
}
}
// XXX also check oid.Valid() ?
// XXX also check oid.Valid() ?
dh
.
Oid
=
zodb
.
Oid
(
binary
.
BigEndian
.
Uint64
(
dh
.
workMem
[
0
:
]))
// XXX -> zodb.Oid.Decode() ?
dh
.
Oid
=
zodb
.
Oid
(
binary
.
BigEndian
.
Uint64
(
dh
.
workMem
[
0
:
]))
dh
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
dh
.
workMem
[
8
:
]))
// XXX -> zodb.Tid.Decode() ?
dh
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
dh
.
workMem
[
8
:
]))
if
!
dh
.
Tid
.
Valid
()
{
if
!
dh
.
Tid
.
Valid
()
{
return
checkErr
(
r
,
dh
,
"invalid tid: %v"
,
dh
.
Tid
)
return
checkErr
(
r
,
dh
,
"invalid tid: %v"
,
dh
.
Tid
)
}
}
...
...
go/zodb/storage/fs1/fs1tools/dump.go
View file @
0dce582b
...
@@ -102,7 +102,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
...
@@ -102,7 +102,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
err
=
it
.
NextTxn
(
fs1
.
LoadAll
)
err
=
it
.
NextTxn
(
fs1
.
LoadAll
)
if
err
!=
nil
{
if
err
!=
nil
{
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
err
=
nil
// XXX -> okEOF(err)
err
=
nil
}
}
return
err
return
err
}
}
...
@@ -110,7 +110,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
...
@@ -110,7 +110,7 @@ func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error) {
err
=
d
.
DumpTxn
(
buf
,
it
)
err
=
d
.
DumpTxn
(
buf
,
it
)
if
err
!=
nil
{
if
err
!=
nil
{
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
err
=
nil
// XXX -> okEOF(err)
err
=
nil
}
}
return
err
return
err
}
}
...
@@ -163,7 +163,7 @@ func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
...
@@ -163,7 +163,7 @@ func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
err
:=
it
.
NextData
()
err
:=
it
.
NextData
()
if
err
!=
nil
{
if
err
!=
nil
{
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
err
=
nil
// XXX -> okEOF(err)
err
=
nil
}
}
return
err
return
err
}
}
...
@@ -359,7 +359,7 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
...
@@ -359,7 +359,7 @@ func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error {
_
,
err
:=
it
.
R
.
ReadAt
(
d
.
data
,
txnh
.
DataPos
())
_
,
err
:=
it
.
R
.
ReadAt
(
d
.
data
,
txnh
.
DataPos
())
if
err
!=
nil
{
if
err
!=
nil
{
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
err
=
io
.
ErrUnexpectedEOF
// XXX -> noEOF(err)
err
=
io
.
ErrUnexpectedEOF
}
}
// XXX dup wrt fs1.TxnHeader.err
// XXX dup wrt fs1.TxnHeader.err
return
&
fs1
.
RecordError
{
xio
.
Name
(
it
.
R
),
"transaction record"
,
txnh
.
Pos
,
"read data payload"
,
err
}
return
&
fs1
.
RecordError
{
xio
.
Name
(
it
.
R
),
"transaction record"
,
txnh
.
Pos
,
"read data payload"
,
err
}
...
...
go/zodb/storage/fs1/fsb/fsbtree.go
View file @
0dce582b
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// 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
// KEY=zodb.Oid VALUE=int64
// ---- 8< ----
// ---- 8< ----
...
...
go/zodb/storage/fs1/fsb/fsbtree_util.go
View file @
0dce582b
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// 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< ----
// ---- 8< ----
package
fsb
package
fsb
...
...
go/zodb/storage/fs1/fsb/gen-fsbtree
View file @
0dce582b
...
@@ -28,12 +28,24 @@ de=16 # KEY+VALUE
...
@@ -28,12 +28,24 @@ de=16 # KEY+VALUE
o
=
24
#
d
.
c
,
d
.
n
,
d
.
p
o
=
24
#
d
.
c
,
d
.
n
,
d
.
p
kd
=$((
(
4096
-
$
o
-
$
de
)
/
(
2
*
$
de
)
))
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
b
=
github
.
com
/
cznic
/
b
Bdir
=`
go
list
-
f
'{{.Dir}}'
$
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
out
=
fsbtree
.
go
echo
"// Code generated by gen-fsbtree from $b $Brev; DO NOT EDIT."
>$
out
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
"// KEY=$KEY VALUE=$VALUE"
>>$
out
echo
"// ---- 8< ----"
>>$
out
echo
"// ---- 8< ----"
>>$
out
echo
>>$
out
echo
>>$
out
...
@@ -56,6 +68,8 @@ make -s -C $Bdir generic |sed \
...
@@ -56,6 +68,8 @@ make -s -C $Bdir generic |sed \
#
also
extract
dump
()
routine
#
also
extract
dump
()
routine
out
=
fsbtree_util
.
go
out
=
fsbtree_util
.
go
echo
"// Code generated by gen-fsbtree from $b $Brev; DO NOT EDIT."
>$
out
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
"// ---- 8< ----"
>>$
out
echo
>>$
out
echo
>>$
out
cat
>>$
out
<<
EOF
cat
>>$
out
<<
EOF
...
...
go/zodb/storage/fs1/util.go
View file @
0dce582b
...
@@ -23,7 +23,6 @@ import (
...
@@ -23,7 +23,6 @@ import (
"io"
"io"
)
)
// XXX -> xio ?
// noEOF returns err, but changes io.EOF -> io.ErrUnexpectedEOF
// noEOF returns err, but changes io.EOF -> io.ErrUnexpectedEOF
func
noEOF
(
err
error
)
error
{
func
noEOF
(
err
error
)
error
{
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
...
...
go/zodb/zodb.go
View file @
0dce582b
...
@@ -239,8 +239,8 @@ type IStorageDriver interface {
...
@@ -239,8 +239,8 @@ type IStorageDriver interface {
// TODO: write mode
// TODO: write mode
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) error
// Store(
ctx,
oid Oid, serial Tid, data []byte, txn ITransaction) error
// StoreKeepCurrent(oid Oid, serial Tid, txn ITransaction)
// StoreKeepCurrent(
ctx,
oid Oid, serial Tid, txn ITransaction)
// TpcBegin(txn)
// TpcBegin(txn)
// TpcVote(txn)
// TpcVote(txn)
...
...
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