Commit e21fe877 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a726770c
...@@ -683,7 +683,7 @@ func (m *Master) verify(ctx context.Context) (err error) { ...@@ -683,7 +683,7 @@ func (m *Master) verify(ctx context.Context) (err error) {
} }
// start verification on all storages we are currently in touch with // start verification on all storages we are currently in touch with
for _, peer := range m.peerTab() { for _, peer := range m.peerTab {
if peer.node.Type == proto.STORAGE { if peer.node.Type == proto.STORAGE {
goStorCtlVerify(peer) goStorCtlVerify(peer)
} }
...@@ -794,26 +794,23 @@ loop2: ...@@ -794,26 +794,23 @@ loop2:
// storVerify is result of a storage node passing verification phase. // storVerify is result of a storage node passing verification phase.
type storVerify struct { type storVerify struct {
stor *xneo.PeerNode stor *_MasteredPeer
lastOid zodb.Oid lastOid zodb.Oid
lastTid zodb.Tid lastTid zodb.Tid
err error err error
} }
// storCtlVerify drives a storage node during cluster verifying (= starting) state. // storCtlVerify drives a storage node during cluster verifying (= starting) state.
func storCtlVerify(ctx context.Context, stor *xneo.PeerNode, pt *xneo.PartitionTable, res chan storVerify) { func storCtlVerify(ctx context.Context, stor *_MasteredPeer, pt *xneo.PartitionTable) (lastOid zodb.Oid, lastTid zodb.Tid, err error) {
// XXX link.Close on err -> = xcontext.WithCloseOnErrCancel // XXX link.Close on err -> = xcontext.WithCloseOnErrCancel
// XXX cancel on ctx -> = ^^^ // XXX cancel on ctx -> = ^^^
var err error
defer func() {
if err != nil {
res <- storVerify{stor: stor, err: err}
}
}()
slink := stor.Link() slink := stor.Link()
defer task.Runningf(&ctx, "%s: stor verify", stor.node.NID)(&err) defer task.Runningf(&ctx, "%s: stor verify", stor.node.NID)(&err)
lastOid = zodb.InvalidOid
lastTid = zodb.InvalidTid
// send just recovered parttab so storage saves it // send just recovered parttab so storage saves it
err = slink.Send1(&proto.SendPartitionTable{ err = slink.Send1(&proto.SendPartitionTable{
PTid: pt.PTid, PTid: pt.PTid,
...@@ -842,8 +839,7 @@ func storCtlVerify(ctx context.Context, stor *xneo.PeerNode, pt *xneo.PartitionT ...@@ -842,8 +839,7 @@ func storCtlVerify(ctx context.Context, stor *xneo.PeerNode, pt *xneo.PartitionT
return return
} }
// send results to driver return last.LastOid, last.LastTid, nil
res <- storVerify{stor: stor, lastOid: last.LastOid, lastTid: last.LastTid}
} }
......
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