Commit c70467a6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent aa17a79e
...@@ -158,7 +158,6 @@ func (b *Backend) LastTid(ctx context.Context) (zodb.Tid, error) { ...@@ -158,7 +158,6 @@ func (b *Backend) LastTid(ctx context.Context) (zodb.Tid, error) {
return 0, nil return 0, nil
} }
// XXX ok to reuse zodb.OpError here? or better it should be storage.OpError ?
return 0, &zodb.OpError{URL: b.url, Op: "last_tid", Err: err} return 0, &zodb.OpError{URL: b.url, Op: "last_tid", Err: err}
} }
...@@ -166,7 +165,25 @@ func (b *Backend) LastTid(ctx context.Context) (zodb.Tid, error) { ...@@ -166,7 +165,25 @@ func (b *Backend) LastTid(ctx context.Context) (zodb.Tid, error) {
} }
func (b *Backend) LastOid(ctx context.Context) (zodb.Oid, error) { func (b *Backend) LastOid(ctx context.Context) (zodb.Oid, error) {
panic("TODO") var lastOid zodb.Oid
// FIXME nodeID <- my node UUID
myID := proto.UUID(proto.STORAGE, 1)
err := b.query1(ctx,
"SELECT MAX(oid) FROM pt, obj WHERE nid=? AND rid=partition",
myID).Scan(lastOid)
if err != nil {
// no objects
if err == sql.ErrNoRows {
return proto.INVALID_OID, nil
}
return 0, &zodb.OpError{URL: b.url, Op: "last_oid", Err: err}
}
return lastOid, nil
} }
func (b *Backend) Load(ctx context.Context, xid zodb.Xid) (_ *proto.AnswerObject, err error) { func (b *Backend) Load(ctx context.Context, xid zodb.Xid) (_ *proto.AnswerObject, err error) {
...@@ -303,7 +320,7 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) { ...@@ -303,7 +320,7 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) {
} }
// config("version") vs version // config("version")
// config("nid") // config("nid")
// config("partitions") // config("partitions")
// config("replicas") // config("replicas")
......
...@@ -32,6 +32,8 @@ import ( ...@@ -32,6 +32,8 @@ import (
) )
// Backend is the interface for actual storage service that is used by neo.Storage node. // Backend is the interface for actual storage service that is used by neo.Storage node.
//
// XXX ok to reuse zodb.OpError for errors? or better it should be storage.OpError?
type Backend interface { type Backend interface {
// LastTid should return the id of the last committed transaction. // LastTid should return the id of the last committed transaction.
// //
......
...@@ -307,9 +307,16 @@ Zpy() { ...@@ -307,9 +307,16 @@ Zpy() {
# ---- start NEO clusters ---- # ---- start NEO clusters ----
# spawn NEO/go cluster (Sgo+Mpy+Apy) working on data.fs # spawn NEO/go cluster (Sgo+Mpy+Apy) working on data.fs
NEOgo() { NEOgofs1() {
Mpy --autostart=1 Mpy --autostart=1
Sgo $fs1/data.fs Sgo fs1://$fs1/data.fs
Apy
}
# spawn NEO/go cluster (Sgo+Mpy+Apy) working on sqlite db
NEOgolite() {
Mpy --autostart=1
Sgo sqlite://$neolite
Apy Apy
} }
...@@ -1119,15 +1126,27 @@ zbench_local() { ...@@ -1119,15 +1126,27 @@ zbench_local() {
xmysql -e "SHUTDOWN" xmysql -e "SHUTDOWN"
wait wait
echo -e "\n*** NEO/go" echo -e "\n*** NEO/go fs1"
NEOgo NEOgofs1
zbench neo://$neocluster@$Mbind `hostname`/neo/go $zhashok zbench neo://$neocluster@$Mbind `hostname`/neo/go/fs1 $zhashok
xneoctl set cluster stopping
wait
echo -e "\n*** NEO/go fs1 (sha1 disabled)"
X_NEOGO_SHA1_SKIP=y NEOgofs1
X_NEOGO_SHA1_SKIP=y zbench_go neo://$neocluster@$Mbind "`hostname`/neo/go/fs1(!sha1)" $zhashok
xneoctl set cluster stopping
wait
echo -e "\n*** NEO/go sqlite"
NEOgolite
zbench neo://$neocluster@$Mbind `hostname`/neo/go/sqlite $zhashok
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
echo -e "\n*** NEO/go (sha1 disabled)" echo -e "\n*** NEO/go sqlite (sha1 disabled)"
X_NEOGO_SHA1_SKIP=y NEOgo X_NEOGO_SHA1_SKIP=y NEOgolite
X_NEOGO_SHA1_SKIP=y zbench_go neo://$neocluster@$Mbind "`hostname`/neo/go(!sha1)" $zhashok X_NEOGO_SHA1_SKIP=y zbench_go neo://$neocluster@$Mbind "`hostname`/neo/go/sqlite(!sha1)" $zhashok
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
} }
...@@ -1215,15 +1234,27 @@ zbench_cluster() { ...@@ -1215,15 +1234,27 @@ zbench_cluster() {
xmysql -e "SHUTDOWN" xmysql -e "SHUTDOWN"
wait wait
echo -e "\n*** NEO/go" echo -e "\n*** NEO/go fs"
NEOgo NEOgofs1
on $url ./neotest zbench-client neo://$neocluster@$Mbind "`hostname`-$peer/neo/go" $zhashok on $url ./neotest zbench-client neo://$neocluster@$Mbind "`hostname`-$peer/neo/go/fs1" $zhashok
xneoctl set cluster stopping
wait
echo -e "\n*** NEO/go fs1 (sha1 disabled)"
X_NEOGO_SHA1_SKIP=y NEOgofs1
on $url X_NEOGO_SHA1_SKIP=y ./neotest zbench-client --goonly neo://$neocluster@$Mbind "\\\"`hostname`-$peer/neo/go/fs1(!sha1)\\\"" $zhashok
xneoctl set cluster stopping
wait
echo -e "\n*** NEO/go sqlite"
NEOgolite
on $url ./neotest zbench-client neo://$neocluster@$Mbind "`hostname`-$peer/neo/go/sqlite" $zhashok
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
echo -e "\n*** NEO/go (sha1 disabled)" echo -e "\n*** NEO/go sqlite (sha1 disabled)"
X_NEOGO_SHA1_SKIP=y NEOgo X_NEOGO_SHA1_SKIP=y NEOgolite
on $url X_NEOGO_SHA1_SKIP=y ./neotest zbench-client --goonly neo://$neocluster@$Mbind "\\\"`hostname`-$peer/neo/go(!sha1)\\\"" $zhashok on $url X_NEOGO_SHA1_SKIP=y ./neotest zbench-client --goonly neo://$neocluster@$Mbind "\\\"`hostname`-$peer/neo/go/sqlite(!sha1)\\\"" $zhashok
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
} }
......
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