Migrations altering Appearances need to clear cache
https://gitlab.com/gitlab-org/gitlab-ee/blob/10-7-stable-ee/ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb was added in 10.7 RC1 and deployed to staging.gitlab.com
We immediately started seeing this error: https://sentry.gitlap.com/gitlab/staginggitlabcom/issues/158428/
@stanhu isolated it to a caching issue, and found that https://gitlab.com/gitlab-org/gitlab-ee/blob/10-7-stable-ee/db/migrate/20171122131600_add_new_project_guidelines_to_appearances.rb calls Rails.cache.delete('current_appearance')
in order to remove the caching on that table.
I executed that in a staging console and verified it resolved the error. We'll need to:
-
Update the existing migration to clear the cache before a deploy to production -
Discuss adding a new migration that will perform the cache invalidation -
Discuss a more permanent, robust solution, such as modifying the cache key to include the GitLab version or SHA, so that it's "cleared" automatically (credit to @stanhu)