Commit 3d31d3c1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0e4fc602
...@@ -60,17 +60,27 @@ func TestMasterStorage(t *testing.T) { ...@@ -60,17 +60,27 @@ func TestMasterStorage(t *testing.T) {
Mctx, Mcancel := context.WithCancel(context.Background()) Mctx, Mcancel := context.WithCancel(context.Background())
Sctx, Scancel := context.WithCancel(context.Background()) Sctx, Scancel := context.WithCancel(context.Background())
_ = Scancel;
_ = Scancel; _ = Mcancel; //Mev := M.subscribe(...)
err := M.Run(Mctx) // XXX go wg := WorkGroup()
err = S.Run(Sctx) // XXX go wg.Gox(func() {
err := M.Run(Mctx)
_ = err // XXX
})
//ev <- Mev
//assert ev == ClusterInformation{State: RECOVERY}
// XXX temp if false {
if err != nil { err := S.Run(Sctx) // XXX go
panic(err) _ = err
} }
xwait(wg)
Mcancel() // XXX temp
} }
// basic interaction between Client -- Storage // basic interaction between Client -- Storage
......
...@@ -173,7 +173,7 @@ func nodeLinkPipe() (nl1, nl2 *NodeLink) { ...@@ -173,7 +173,7 @@ func nodeLinkPipe() (nl1, nl2 *NodeLink) {
return _nodeLinkPipe(0, 0) return _nodeLinkPipe(0, 0)
} }
// XXX temp for cluster_test.fo // XXX temp for cluster_test.go
var NodeLinkPipe = nodeLinkPipe var NodeLinkPipe = nodeLinkPipe
func TestNodeLink(t *testing.T) { func TestNodeLink(t *testing.T) {
......
...@@ -86,6 +86,8 @@ type Node struct { ...@@ -86,6 +86,8 @@ type Node struct {
Link *NodeLink // link to this node; =nil if not connected XXX do we need it here ? Link *NodeLink // link to this node; =nil if not connected XXX do we need it here ?
// XXX identified or not ? // XXX identified or not ?
// XXX -> not needed - we only add something to nodetab after identification // XXX -> not needed - we only add something to nodetab after identification
// XXX ^^^ is about master. How about e.g. Client that received nodetab
// entry and wants to talk to that node?
} }
......
...@@ -635,7 +635,7 @@ func (m *Master) accept(n nodeCome) (node *neo.Node, ok bool) { ...@@ -635,7 +635,7 @@ func (m *Master) accept(n nodeCome) (node *neo.Node, ok bool) {
IdTimestamp: monotime(), IdTimestamp: monotime(),
} }
node = m.nodeTab.Update(nodeInfo, n.link) // NOTE this notifies al nodeTab subscribers node = m.nodeTab.Update(nodeInfo, n.link) // NOTE this notifies all nodeTab subscribers
return node, true return node, true
} }
...@@ -730,6 +730,11 @@ func (m *Master) ServeLink(ctx context.Context, link *neo.NodeLink) { ...@@ -730,6 +730,11 @@ func (m *Master) ServeLink(ctx context.Context, link *neo.NodeLink) {
logf("identify: accepted") logf("identify: accepted")
// XXX on successful identification master should also give us:
// - full snapshots of nodeTab, partTab and clusterState
// - buffered notification channel subscribed to changes of ^^^
// - unsubscribe func XXX needed? -> nodeLeave is enough
// ---------------------------------------- // ----------------------------------------
// XXX recheck vvv // XXX recheck vvv
......
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