install: Keep relay available while upgrading (#615)
This continues on the ideas from #607. By "downtime" here I mean "not accepting events" - web, smtp and background processes are out of scope.
This PR adds a --minimize-downtime option to install.sh. This options changes the behaviour of the script by:
- keeping nginx and relay running until the very end,
- disabling cleanup on exit and failure,
- explicitly reloading nginx configuration,
- and starting the whole cluster at the end.
The results are promising: no downtime if relay version doesn't change, and only a second when it does. So far this was only tested with a curl loop, so I'm still not sure if Relay flushes the events to Sentry before getting recreated by $dc up.