Commit 5ef342b1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0ef5e1ba
...@@ -150,7 +150,7 @@ EOF ...@@ -150,7 +150,7 @@ EOF
mysql_install_db --defaults-file=$mycnf mysql_install_db --defaults-file=$mycnf
fi fi
mysqld --defaults-file=$mycnf & mysqld --defaults-file=$mycnf --log-error=$log/mdb.log &
} }
xmysql() { xmysql() {
...@@ -208,8 +208,8 @@ gensqlite() { ...@@ -208,8 +208,8 @@ gensqlite() {
#neopylite #neopylite
neopysql neopysql
#time demo-zbigarray read neo://$cluster@$Mbind #time demo-zbigarray read neo://$cluster@$Mbind
./zsha1.py neo://$cluster@$Mbind #./zsha1.py neo://$cluster@$Mbind 2>py.log
go run zsha1.go neo://$cluster@$Mbind go run zsha1.go neo://$cluster@$Mbind 2>go.log
xneoctl set cluster stopping xneoctl set cluster stopping
xmysql -e "SHUTDOWN" xmysql -e "SHUTDOWN"
......
// zsha1 - compute sha1 of whole latest objects stream in a ZODB database // zsha1 - compute sha1 of whole latest objects stream in a ZODB database
package main package main
// +build ignore
import ( import (
"context" "context"
"crypto/sha1" "crypto/sha1"
...@@ -32,7 +34,9 @@ func main() { ...@@ -32,7 +34,9 @@ func main() {
} }
before := lastTid + 1 // XXX overflow ? before := lastTid + 1 // XXX overflow ?
defer profile.Start().Stop() if false {
defer profile.Start().Stop()
}
tstart := time.Now() tstart := time.Now()
m := sha1.New() m := sha1.New()
...@@ -42,7 +46,7 @@ func main() { ...@@ -42,7 +46,7 @@ func main() {
loop: loop:
for { for {
xid := zodb.Xid{Oid: oid, XTid: zodb.XTid{Tid: before, TidBefore: true}} xid := zodb.Xid{Oid: oid, XTid: zodb.XTid{Tid: before, TidBefore: true}}
data, _, err := stor.Load(bg, xid) data, serial, err := stor.Load(bg, xid)
switch err.(type) { switch err.(type) {
case nil: case nil:
// ok // ok
...@@ -54,6 +58,8 @@ loop: ...@@ -54,6 +58,8 @@ loop:
m.Write(data) m.Write(data)
fmt.Fprintf(os.Stderr, "%d @%s\tsha1: %x\n", uint(oid), serial, m.Sum(nil))
nread += len(data) nread += len(data)
oid += 1 oid += 1
} }
......
#!/usr/bin/env python #!/usr/bin/env python
"""zsha1 - compute sha1 of whole latest objects stream in a ZODB database""" """zsha1 - compute sha1 of whole latest objects stream in a ZODB database"""
from __future__ import print_function
import zodbtools.util import zodbtools.util
from ZODB.POSException import POSKeyError from ZODB.POSException import POSKeyError
from ZODB.utils import p64, u64 from ZODB.utils import p64, u64
...@@ -27,9 +29,10 @@ def main(): ...@@ -27,9 +29,10 @@ def main():
except POSKeyError: except POSKeyError:
break break
#print('%s @%s' % (oid, u64(serial)))
m.update(data) m.update(data)
print('%s @%s\tsha1: %s' % (oid, u64(serial), m.hexdigest()), file=sys.stderr)
nread += len(data) nread += len(data)
oid += 1 oid += 1
......
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