Commit 60644d0b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c6ea3739
......@@ -163,7 +163,7 @@ func (c *Client) talkMaster(ctx context.Context) (err error) {
// XXX dup wrt Storage.talkMaster
for {
err := c.talkMaster1(ctx)
log.Error(ctx, err)
log.Warning(ctx, err) // XXX Warning ok? -> Error?
// TODO if err = shutdown -> return
......
......@@ -154,7 +154,7 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// XXX dup wrt Client.talkMaster
for {
err := stor.talkMaster1(ctx)
log.Error(ctx, err)
log.Warning(ctx, err) // XXX Warning ok? -> Error?
// TODO if err = shutdown -> return
......@@ -200,13 +200,13 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// let master initialize us. If successful this ends with StartOperation command.
reqStart, err := stor.m1initialize(ctx, mlink)
if err != nil {
log.Error(ctx, err)
//log.Error(ctx, err)
return err
}
// we got StartOperation command. Let master drive us during servicing phase.
err = stor.m1serve(ctx, reqStart)
log.Error(ctx, err)
//log.Error(ctx, err)
return err
}
......
......@@ -31,6 +31,18 @@ xmysql() {
mysql --defaults-file=$mycnf "$@"
}
# if we are abnormally terminating
trap 'set +e
echo "E: abnormal termination - stopping..."
xneoctl set cluster stopping
sleep 1
xmysql -e "SHUTDOWN"
sleep 1
j="$(jobs -p)"
test -z "$j" && exit
echo "E: killing jobs..."
jobs -l
kill $j' EXIT
# ---- start NEO nodes ----
......@@ -271,6 +283,8 @@ done
xneoctl set cluster stopping
wait
# all ok
trap - EXIT
exit
# ----------------------------------------
......
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