Skip to content

🐛(playbook) avoid downtime during switch or rollback#434

Merged
madmatah merged 1 commit intomasterfrom
avoid-switch-downtime
Jan 14, 2020
Merged

🐛(playbook) avoid downtime during switch or rollback#434
madmatah merged 1 commit intomasterfrom
avoid-switch-downtime

Conversation

@madmatah
Copy link
Copy Markdown
Contributor

Purpose

The switch_routes ansible task leave the current route in an invalid state for a few seconds when switch or rollback playbooks are executed. It can introduce an unnecessary downtime during a deployment.

For example, I have the hello app deployed with the following versions :

  • next : d-200113-09h05m11s
  • current : d-200113-08h58m09s
  • previous : d-200113-08h55m23s

If I execute a switch, I can find this in my logs :

$ bin/switch -e "apps_filter=hello" | grep --line-buffered -i "patching routes with prefix" | ts '[%Y-%m-%d %H:%M:%.S]'

[2020-01-13 10:08:25.433209] TASK [Patching routes with prefix previous for the hello application with deployment_stamp d-200113-08h58m09s] ***
[2020-01-13 10:08:26.760792] TASK [Patching routes with prefix current for the hello application with deployment_stamp] ***
[2020-01-13 10:08:29.672389] TASK [Patching routes with prefix current for the hello application with deployment_stamp d-200113-09h05m11s] ***
[2020-01-13 10:08:30.687389] TASK [Patching routes with prefix next for the hello application with deployment_stamp] ***

Between 10:08:26 and 10:08:29, the current route is pointing to an undefined deployment stamp.

Proposal

Do not execute the second step in the above example.

@madmatah madmatah force-pushed the avoid-switch-downtime branch from 5ecce67 to ba2cf17 Compare January 13, 2020 15:50
@madmatah madmatah changed the title WIP 🐛(playbook) Avoid downtime during switch or rollback 🐛(playbook) avoid downtime during switch or rollback Jan 13, 2020
@madmatah madmatah added needs review and removed WIP labels Jan 13, 2020
Copy link
Copy Markdown
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Comment thread CHANGELOG.md Outdated
The current switch_routes  ansible task leave the current  route in an
undefined state  for a few  seconds when switch or  rollback playbooks
are executed.
@madmatah madmatah force-pushed the avoid-switch-downtime branch from ba2cf17 to 8e21b2e Compare January 14, 2020 09:04
@madmatah madmatah merged commit 7532936 into master Jan 14, 2020
@madmatah madmatah deleted the avoid-switch-downtime branch January 14, 2020 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants