How release canaries can save your bacon
cloudplatform.googleblog.com
cloudplatform.googleblog.com
There are places where post-mortems can turn into blame games, but in my experience such things are counter-productive to actually solving problems. Luckily, there are plenty of engineering organizations that do not make this mistake! :)
On the other hand, what you're talking about shouldn't be that hard to implement. Just hook your rollback system into your issue tracker to create a post-mortem issue whenever a rollback is necessary, and assign it to whoever initiated the deployment (or their manager). Easy.
On the third hand, you might end up finding that a lot of your post-mortems end up looking something like "we don't have reproduceable builds and we made a managerial decision not to invest in that now". And now you just created a ton of recurring paperwork for everyone with little benefit.
While I agree on your points that it is better to catch errors earlier in the pipeline and the necessity of mini-postmortems, I personally think that rollbacks are inevitable and compare them to backups. Of course it is better not to restore from backups, it is easy to rationalise good processes over a few metric tons of never been read backup tapes, but a single accidental drop of production database may quickly pay for all the effort put into ensuring backing up works.
It is amusing, because we are basically saying it would be awesome to have a coredump when the crash happens. Which... used to be standard behavior but was essentially lost in most modern development environments. (Not to mention the tooling lagged in two directions. One to help you with the coredumps, and the other to make usable core dumps.)
Staged rollouts are part of the QA strategy (whether this is something to be aspired is another question).
The draw back is that prod needs to be tolerant of multiple versions. Which is usually a fine practice in itself, anyway!
With dedicated hardware, you need twice as much hardware. With cloud, you only pay double for 10 minutes during the rollout, which usually is very cheap.
Rainforest QA had a blog post on strategies a while ago.
One could imagine a test rig which created a db with test users in it, then ran v1 of the software, then v2, then v1 again, and checked v1 didn't crash on the now mutated datastructures.
Most datastore mutations might only happen on certain user actions and inputs, so making sure you get full coverage would be rather tricky.
I like that -- reminds me of aviation, where a go-around is normal. If your approach to landing isn't stabilized, you're too high, too low, too fast, too slow, etc. don't try to save it. Go around and try again.
Next we plan to automate the process - 1 in 10 rollouts will actually be a rollout, a rollback, and another rollout, checking system health at each step.
I wonder which is more prevalent.
This post might also be of interest: https://blog.jayway.com/2016/09/07/continuous-deployment-aws...
Note, I have never done this, this is just how is approach it.
I wouldn't take this advise as it's bad for caching. A change to one JavaScript file will then result in breaking the cache of everything.
The point of the folder versioning scheme the article proposes is to make rollbacks easier. You can easily rollback a /assets/v2 folder to /assets/v1 by updating your server template, but if you have a dozen separate version folders (with different latest version numbers) for each resource then it's no longer easy to roll those all back.
How we do this at Google? Okay, tell me how to roll back the crap Android 6 upgrade back to 5 on this Samsung tablet I have here.
Continuous automated deployments might not be a great fit for satlellite control software but that doesn't mean SaaS apps should switch to the same process as satellite software teams.
[...] if it breaks, real users get affected, so canarying should be the first step in your deployment process, as opposed to the last step in testing.
It's a fine pattern and all, but not an excuse to throw stuff at prod and see what happens.The point of the canary is it gives you one last real world test where you can limit the damage if anything goes wrong. Without it, you'll have to assume your tests are perfect, and I doubt that's ever achieved in practice in a real environment, except maybe in avionics and space control systems.
The problem with production traffic is you will never be able to simulate it perfectly. At the end of the day you are required to flip a switch and test things out in the wild.
https://cloud.google.com/customers/
Spotify, SnapChat, eBay are the examples I usually give when asked that question.
I'm not sure what numbers I am allowed to provide for any of them, but there's some public information available that gives you a sense of the scale involved:
https://labs.spotify.com/2016/03/03/spotifys-event-delivery-...
https://www.itnews.com.au/news/do-not-fear-the-cloud-ebay-mi...
It's a little hard to take this advice from Google after being the victim of so many bad rollouts. Because we use a lot of services, we are far more likely to have problems. We seem to always be the canary.
That's not fun.
It is common for a system to work fine before and after a rollout, but during a rollout clients experience errors.
One might imagine downloading a big file for example, which takes an hour. If you are downloading that from http-server-v1, which is being upgraded to http-server-v2, there will be a small grace period for clients of v1 to complete their operations. That grace period in many datacenters is often 30 seconds. That means if your operation is long running, you would see a failure. The error code is usually HTTP 503, for which your client logic should retry the request with an exponential backoff.
If your client doesn't retry/resume the request, now you see the service as down, when in fact the error you are seeing is by design. It will happen for every release, but also when servers come and go for maintanance, or for a bunch of other reasons.
Good libraries will handle retries for you, but some don't properly, and thats a bug.