Skip to content

Commit 5f510d5

Browse files
committed
Merge pull request #2307 from carmstrong/deisctl_wait_on_stop
fix(deisctl): use wait groups for stopping and uninstalling store
2 parents 99d31a8 + 59f2bb5 commit 5f510d5

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

deisctl/cmd/cmd.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ func startDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan st
131131
b.Start([]string{"store-metadata"}, wg, outchan, errchan)
132132
wg.Wait()
133133

134-
b.Start([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
134+
// we start gateway first to give metadata time to come up for volume
135+
b.Start([]string{"store-gateway"}, wg, outchan, errchan)
136+
wg.Wait()
137+
b.Start([]string{"store-volume"}, wg, outchan, errchan)
135138
wg.Wait()
136139

137140
// start logging subsystem first to collect logs from other components
@@ -221,9 +224,14 @@ func stopDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan str
221224
wg.Wait()
222225

223226
outchan <- fmt.Sprintf("Storage subsystem...")
224-
b.Stop([]string{"store-gateway", "store-volume", "store-metadata", "store-monitor", "store-daemon"}, wg, outchan, errchan)
227+
b.Stop([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
228+
wg.Wait()
229+
b.Stop([]string{"store-metadata"}, wg, outchan, errchan)
230+
wg.Wait()
231+
b.Stop([]string{"store-daemon"}, wg, outchan, errchan)
232+
wg.Wait()
233+
b.Stop([]string{"store-monitor"}, wg, outchan, errchan)
225234
wg.Wait()
226-
227235
}
228236

229237
func Restart(b backend.Backend, targets []string) error {
@@ -379,7 +387,13 @@ func uninstallAllServices(b backend.Backend, wg *sync.WaitGroup, outchan chan st
379387
wg.Wait()
380388

381389
outchan <- fmt.Sprintf("Storage subsystem...")
382-
b.Destroy([]string{"store-gateway", "store-volume", "store-metadata", "store-monitor", "store-daemon"}, wg, outchan, errchan)
390+
b.Destroy([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
391+
wg.Wait()
392+
b.Destroy([]string{"store-metadata"}, wg, outchan, errchan)
393+
wg.Wait()
394+
b.Destroy([]string{"store-daemon"}, wg, outchan, errchan)
395+
wg.Wait()
396+
b.Destroy([]string{"store-monitor"}, wg, outchan, errchan)
383397
wg.Wait()
384398

385399
return nil

docs/managing_deis/upgrading-deis.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ and then reinstall platform components.
2424

2525
In-place upgrades are supported starting from Deis version 0.14.0
2626

27+
.. note::
28+
29+
Occasionally, when upgrading Deis, we have seen deisctl stuck in a restart loop on ``deis-store`` components.
30+
The workaround for this is to restart the store-daemons with ``deisctl restart store-daemon``. If run while
31+
the original ``deisctl start platform`` command is still running, it should resume almost immediately.
32+
2733
Use the following steps to perform an in-place upgrade of your Deis cluster.
2834

2935
.. code-block:: console
3036
31-
$ deisctl uninstall platform
37+
$ deisctl stop platform && deisctl uninstall platform
3238
$ deisctl config platform set version=v0.15.0
3339
$ deisctl install platform
3440
$ deisctl start platform

0 commit comments

Comments
 (0)