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) {
}
// 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 {
goStorCtlVerify(peer)
}
......@@ -794,26 +794,23 @@ loop2:
// storVerify is result of a storage node passing verification phase.
type storVerify struct {
stor *xneo.PeerNode
stor *_MasteredPeer
lastOid zodb.Oid
lastTid zodb.Tid
err error
}
// 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 cancel on ctx -> = ^^^
var err error
defer func() {
if err != nil {
res <- storVerify{stor: stor, err: err}
}
}()
slink := stor.Link()
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
err = slink.Send1(&proto.SendPartitionTable{
PTid: pt.PTid,
......@@ -842,8 +839,7 @@ func storCtlVerify(ctx context.Context, stor *xneo.PeerNode, pt *xneo.PartitionT
return
}
// send results to driver
res <- storVerify{stor: stor, lastOid: last.LastOid, lastTid: last.LastTid}
return last.LastOid, last.LastTid, nil
}
......
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