Commit 081210a3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8b0d5744
...@@ -171,6 +171,8 @@ func NewMaster(clusterName string, net xnet.Networker) *Master { ...@@ -171,6 +171,8 @@ func NewMaster(clusterName string, net xnet.Networker) *Master {
return m return m
} }
var ErrStartNonOperational = errors.New("start: cluster is non-operational")
// Start requests cluster to eventually transition into running state. // Start requests cluster to eventually transition into running state.
// //
// It returns an error if such transition is not currently possible to begin // It returns an error if such transition is not currently possible to begin
...@@ -180,7 +182,6 @@ func NewMaster(clusterName string, net xnet.Networker) *Master { ...@@ -180,7 +182,6 @@ func NewMaster(clusterName string, net xnet.Networker) *Master {
// NOTE upon successful return cluster is not yet in running state - the transition will // NOTE upon successful return cluster is not yet in running state - the transition will
// take time and could be also automatically aborted due to cluster environment change (e.g. // take time and could be also automatically aborted due to cluster environment change (e.g.
// a storage node goes down). // a storage node goes down).
var ErrStartNonOperational = errors.New("start: cluster is non-operational")
func (m *Master) Start() error { func (m *Master) Start() error {
ech := make(chan error) ech := make(chan error)
m.ctlStart <- ech m.ctlStart <- ech
...@@ -582,7 +583,6 @@ func storCtlRecovery(ctx context.Context, stor *_MasteredPeer) (_ *xneo.Partitio ...@@ -582,7 +583,6 @@ func storCtlRecovery(ctx context.Context, stor *_MasteredPeer) (_ *xneo.Partitio
defer task.Runningf(&ctx, "%s recovery", stor.node.NID)(&err) defer task.Runningf(&ctx, "%s recovery", stor.node.NID)(&err)
// XXX cancel on ctx // XXX cancel on ctx
// XXX close slink on err? (if yes -> xcontext.WithCloseOnErrCancel)
recovery := proto.AnswerRecovery{} recovery := proto.AnswerRecovery{}
err = slink.Ask1(&proto.Recovery{}, &recovery) err = slink.Ask1(&proto.Recovery{}, &recovery)
...@@ -730,7 +730,7 @@ func (m *Master) verify(ctx context.Context) (err error) { ...@@ -730,7 +730,7 @@ func (m *Master) verify(ctx context.Context) (err error) {
// a storage node came through verification - adjust our last{Oid,Tid} if ok // a storage node came through verification - adjust our last{Oid,Tid} if ok
// on error check - whether cluster became non-operational and stop verification if so // on error check - whether cluster became non-operational and stop verification if so
// //
// FIXME actually implement logic to decide to finish/rollback transactions // TODO actually implement logic to decide to finish/rollback transactions
case v := <-verifiedq: case v := <-verifiedq:
close(v.ack) // XXX explain why (see recovery) close(v.ack) // XXX explain why (see recovery)
inprogress-- inprogress--
...@@ -794,7 +794,6 @@ func storCtlVerify(ctx context.Context, stor *_MasteredPeer, pt *xneo.PartitionT ...@@ -794,7 +794,6 @@ func storCtlVerify(ctx context.Context, stor *_MasteredPeer, pt *xneo.PartitionT
} }
if len(locked.TidDict) > 0 { if len(locked.TidDict) > 0 {
// TODO vvv
err = fmt.Errorf("TODO: non-ø locked txns: %v", locked.TidDict) err = fmt.Errorf("TODO: non-ø locked txns: %v", locked.TidDict)
return return
} }
...@@ -857,6 +856,8 @@ func (m *Master) serve(ctx context.Context) (err error) { ...@@ -857,6 +856,8 @@ func (m *Master) serve(ctx context.Context) (err error) {
err = m.serveClient(ctx, peer) err = m.serveClient(ctx, peer)
// XXX ADMIN // XXX ADMIN
default:
err = fmt.Errorf("TODO: serve %s", peer.node.Type)
} }
ack := make(chan struct{}) ack := make(chan struct{})
......
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