Commit 8b0d5744 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4d25e431
...@@ -328,7 +328,7 @@ func (m *Master) main(ctx context.Context) (err error) { ...@@ -328,7 +328,7 @@ func (m *Master) main(ctx context.Context) (err error) {
continue // -> recovery continue // -> recovery
} }
// XXX shutdown request ? // TODO shutdown request ?
} }
return ctx.Err() return ctx.Err()
...@@ -342,7 +342,7 @@ func (m *Master) main(ctx context.Context) (err error) { ...@@ -342,7 +342,7 @@ func (m *Master) main(ctx context.Context) (err error) {
// - accept connections from storage nodes // - accept connections from storage nodes
// - retrieve and recover latest previously saved partition table from storages // - retrieve and recover latest previously saved partition table from storages
// - monitor whether partition table becomes operational wrt currently up nodeset // - monitor whether partition table becomes operational wrt currently up nodeset
// - if yes - finish recovering upon receiving "start" command XXX or autostart // - if yes - finish recovering upon receiving "start" command TODO or autostart
// - start is also allowed if storages connected and say there is no partition // - start is also allowed if storages connected and say there is no partition
// table saved to them (empty new cluster case). // table saved to them (empty new cluster case).
...@@ -352,7 +352,7 @@ type storRecovery struct { ...@@ -352,7 +352,7 @@ type storRecovery struct {
partTab *xneo.PartitionTable partTab *xneo.PartitionTable
err error err error
// XXX + backup_tid, truncate_tid ? // TODO + backup_tid, truncate_tid
// XXX naming cont? continue? unlock? unpause? // XXX naming cont? continue? unlock? unpause?
ack chan struct{} // main -> storCtlRecovery "thanks; please continue" XXX explain why ack chan struct{} // main -> storCtlRecovery "thanks; please continue" XXX explain why
...@@ -373,7 +373,7 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -373,7 +373,7 @@ func (m *Master) recovery(ctx context.Context) (err error) {
recoveredq := make(chan storRecovery) // <- result of 1 stor recovery recoveredq := make(chan storRecovery) // <- result of 1 stor recovery
inprogress := 0 // in-progress stor recoveries inprogress := 0 // in-progress stor recoveries
// requests to .ctlStart received when readyToStart // requests to .ctlStart received when readyToStart=y
// on success answered when full recovery completes // on success answered when full recovery completes
startReqv := []chan error{} startReqv := []chan error{}
defer func() { defer func() {
...@@ -424,7 +424,6 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -424,7 +424,6 @@ func (m *Master) recovery(ctx context.Context) (err error) {
} }
} }
// TODO (?) set cluster state = RECOVERY
// TODO down clients // TODO down clients
// goStorCtlRecovery spawns recovery task on a storage peer. // goStorCtlRecovery spawns recovery task on a storage peer.
...@@ -485,7 +484,7 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -485,7 +484,7 @@ func (m *Master) recovery(ctx context.Context) (err error) {
case <-ctxDone: case <-ctxDone:
stop(ctx.Err()) stop(ctx.Err())
// request to start the cluster - if ok we exit replying ok // request to start the cluster - if ok we queue it to reply ok on successful exit
// if not ok - we just reply not ok // if not ok - we just reply not ok
case ech := <-ctlStart: case ech := <-ctlStart:
if readyToStart { if readyToStart {
...@@ -562,7 +561,6 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -562,7 +561,6 @@ func (m *Master) recovery(ctx context.Context) (err error) {
// if we are starting for new cluster - create partition table // if we are starting for new cluster - create partition table
if m.node.State.PartTab.PTid == 0 { if m.node.State.PartTab.PTid == 0 {
// XXX -> m.nodeTab.StorageList(State > DOWN)
storv := []*xneo.PeerNode{} storv := []*xneo.PeerNode{}
for _, stor := range m.node.State.NodeTab.StorageList() { for _, stor := range m.node.State.NodeTab.StorageList() {
if stor.State > proto.DOWN { if stor.State > proto.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