Commit 547418f2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b8deac3d
...@@ -410,7 +410,7 @@ func storCtlRecovery(ctx context.Context, stor *neo.Node, res chan storRecovery) ...@@ -410,7 +410,7 @@ func storCtlRecovery(ctx context.Context, stor *neo.Node, res chan storRecovery)
// on error provide feedback to storRecovery chan // on error provide feedback to storRecovery chan
res <- storRecovery{stor: stor, err: err} res <- storRecovery{stor: stor, err: err}
}() }()
defer runningf(&ctx, "%s: stor recovery", stor.Link)(&err) defer runningf(&ctx, "%s: stor recovery", stor.Link.RemoteAddr())(&err)
conn, err := stor.Link.NewConn() conn, err := stor.Link.NewConn()
if err != nil { if err != nil {
......
...@@ -146,7 +146,6 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) { ...@@ -146,7 +146,6 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
defer runningf(&ctx, "talk master(%v)", stor.node.MasterAddr)(&err) defer runningf(&ctx, "talk master(%v)", stor.node.MasterAddr)(&err)
for { for {
log.Info(ctx, "connecting ...")
err := stor.talkMaster1(ctx) err := stor.talkMaster1(ctx)
log.Error(ctx, err) log.Error(ctx, err)
...@@ -168,11 +167,15 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) { ...@@ -168,11 +167,15 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// it returns error describing why such cycle had to finish // it returns error describing why such cycle had to finish
// XXX distinguish between temporary problems and non-temporary ones? // XXX distinguish between temporary problems and non-temporary ones?
func (stor *Storage) talkMaster1(ctx context.Context) (err error) { func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// XXX put logging into Dial?
log.Info(ctx, "connecting ...")
Mconn, accept, err := stor.node.Dial(ctx, neo.MASTER, stor.node.MasterAddr) Mconn, accept, err := stor.node.Dial(ctx, neo.MASTER, stor.node.MasterAddr)
if err != nil { if err != nil {
log.Info(ctx, "rejected") // XXX ok here? (err is logged above)
return err return err
} }
log.Info(ctx, "accepted")
Mlink := Mconn.Link() Mlink := Mconn.Link()
// close Mlink on return / cancel // close Mlink on return / cancel
...@@ -189,7 +192,7 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) { ...@@ -189,7 +192,7 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// XXX -> node.Dial ? // XXX -> node.Dial ?
if accept.YourNodeUUID != stor.node.MyInfo.NodeUUID { if accept.YourNodeUUID != stor.node.MyInfo.NodeUUID {
log.Infof(ctx, "%v: master told us to have UUID=%v", Mlink, accept.YourNodeUUID) log.Infof(ctx, "master told us to have UUID=%v", accept.YourNodeUUID)
stor.node.MyInfo.NodeUUID = accept.YourNodeUUID stor.node.MyInfo.NodeUUID = accept.YourNodeUUID
} }
......
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