Commit 561c9f61 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cdea40d3
...@@ -45,11 +45,11 @@ import ( ...@@ -45,11 +45,11 @@ import (
// This way all nodes stay informed about their peers in cluster. // This way all nodes stay informed about their peers in cluster.
// //
// Usage examples: // Usage examples:
//
// - C needs to connect/talk to a storage by uuid // - C needs to connect/talk to a storage by uuid
// (the uuid itself is obtained from PartitionTable by oid). // (the uuid itself is obtained from PartitionTable by oid).
// - S pulls from other S. // - S pulls from other S.
// //
//
// NOTE once a node was added to NodeTable its entry is never deleted: if e.g. // NOTE once a node was added to NodeTable its entry is never deleted: if e.g.
// a connection to node is lost associated entry is marked as having DOWN (XXX // a connection to node is lost associated entry is marked as having DOWN (XXX
// or UNKNOWN ?) node state. // or UNKNOWN ?) node state.
...@@ -104,7 +104,7 @@ type dialed struct { ...@@ -104,7 +104,7 @@ type dialed struct {
ready chan struct{} ready chan struct{}
} }
// Link returns link to the peer. // Link returns link to peer node.
// //
// If the link was not yet established Link dials the peer appropriately, // If the link was not yet established Link dials the peer appropriately,
// handshakes, requests identification and checks that identification reply is // handshakes, requests identification and checks that identification reply is
......
...@@ -24,7 +24,6 @@ import ( ...@@ -24,7 +24,6 @@ import (
"context" "context"
stderrors "errors" stderrors "errors"
"fmt" "fmt"
// "math"
"sync" "sync"
"time" "time"
...@@ -237,7 +236,10 @@ func (m *Master) runMain(ctx context.Context) (err error) { ...@@ -237,7 +236,10 @@ func (m *Master) runMain(ctx context.Context) (err error) {
defer task.Running(&ctx, "main")(&err) defer task.Running(&ctx, "main")(&err)
// NOTE Run's goroutine is the only mutator of nodeTab, partTab and other cluster state // NOTE Run's goroutine is the only mutator of nodeTab, partTab and other cluster state
// XXX however since clients request state reading we should use node.StateMu
// XXX however since clients request state reading we should use node.StateMu?
// XXX -> better rework protocol so that master pushes itself (not
// being pulled) to clients everything they need.
for ctx.Err() == nil { for ctx.Err() == nil {
// recover partition table from storages and wait till enough // recover partition table from storages and wait till enough
...@@ -371,6 +373,7 @@ loop: ...@@ -371,6 +373,7 @@ loop:
// close stor link / update .nodeTab // close stor link / update .nodeTab
lclose(ctx, r.stor.Link) lclose(ctx, r.stor.Link)
// r.stor.SetState(neo.DOWN)
m.node.NodeTab.SetNodeState(r.stor, neo.DOWN) m.node.NodeTab.SetNodeState(r.stor, neo.DOWN)
} }
......
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