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

.

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