Commit 534b777c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0e4fc73e
...@@ -331,8 +331,11 @@ func TestMasterStorage(t *testing.T) { ...@@ -331,8 +331,11 @@ func TestMasterStorage(t *testing.T) {
// verification ok; M start service // verification ok; M start service
tc.Expect(clusterState(&M.clusterState, neo.ClusterRunning)) tc.Expect(clusterState(&M.clusterState, neo.ClusterRunning))
// TODO ^^^ should be sent to S
tc.Expect(conntx("m:2", "s:2", 1, &neo.StartOperation{Backup: false}))
tc.Expect(conntx("s:2", "m:2", 1, &neo.NotifyReady{})
// M.clusterState <- RUNNING + TODO it should be sent to S
// TODO S leave while service // TODO S leave while service
// TODO S join while service // TODO S join while service
......
...@@ -759,6 +759,12 @@ func storCtlVerify(ctx context.Context, stor *neo.Node, pt *neo.PartitionTable, ...@@ -759,6 +759,12 @@ func storCtlVerify(ctx context.Context, stor *neo.Node, pt *neo.PartitionTable,
// //
// TODO also plan data movement on new storage nodes appearing // TODO also plan data movement on new storage nodes appearing
// nodeServiced is the error returned after service-phase node handling is finished
type nodeServiced {
node *neoNode
err error
}
// service drives cluster during running state // service drives cluster during running state
// //
// TODO document error meanings on return // TODO document error meanings on return
...@@ -771,6 +777,7 @@ func (m *Master) service(ctx context.Context) (err error) { ...@@ -771,6 +777,7 @@ func (m *Master) service(ctx context.Context) (err error) {
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
defer cancel() defer cancel()
service := make(
wg := &sync.WaitGroup{} wg := &sync.WaitGroup{}
// spawn per-storage service driver // spawn per-storage service driver
...@@ -817,6 +824,7 @@ loop: ...@@ -817,6 +824,7 @@ loop:
} }
}() }()
// XXX who sends here?
case n := <-m.nodeLeave: case n := <-m.nodeLeave:
m.nodeTab.SetNodeState(n.node, neo.DOWN) m.nodeTab.SetNodeState(n.node, neo.DOWN)
...@@ -849,7 +857,7 @@ loop: ...@@ -849,7 +857,7 @@ loop:
// storCtlService drives a storage node during cluster service state // storCtlService drives a storage node during cluster service state
// XXX text // XXX text
func storCtlService(ctx context.Context, stor *neo.Node, srv chan serviceXXX) { func storCtlService(ctx context.Context, stor *neo.Node, srv chan serviceErr) {
/* /*
var err error var err error
defer func() { defer func() {
...@@ -861,10 +869,28 @@ func storCtlService(ctx context.Context, stor *neo.Node, srv chan serviceXXX) { ...@@ -861,10 +869,28 @@ func storCtlService(ctx context.Context, stor *neo.Node, srv chan serviceXXX) {
*/ */
conn := stor.Conn conn := stor.Conn
// XXX send nodeTab ?
// XXX send clusterInformation ?
ready := neo.NotifyReady{} ready := neo.NotifyReady{}
err = conn.Ask(&neo.StartOperation{Backup: false}, &ready) err = conn.Ask(&neo.StartOperation{Backup: false}, &ready)
if err != nil { if err != nil {
// XXX ... return err
}
// now wait in a loop
// XXX this should be also controlling transactions
for {
select {
// XXX stub
case <-time.After(1*time.Second):
println(".")
case <-ctx.Done():
// XXX also send StopOperation?
break loop
}
}
} }
// identify processes identification request of just connected node and either accepts or declines it. // identify processes identification request of just connected node and either accepts or declines it.
......
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