diff options
author | Nick Thomas <nick@gitlab.com> | 2019-09-10 14:10:38 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-10 14:33:51 +0100 |
commit | 034f0340a3e5c4c593916526246fccf0737ab0e3 (patch) | |
tree | 51eaeca362f7603075c755e1be973c4ebda058c8 /app | |
parent | 4cd6c91d5f1f3e58e2f2a58d16691d0651f24a7e (diff) | |
download | gitlab-ce-034f0340a3e5c4c593916526246fccf0737ab0e3.tar.gz |
Don't use the redis set cache yet
For zero-downtime deployed in a mixed code environment between 12.2 and
12.3, the branch and tag name cache is incorrectly invalidated - a push
to an old machine will not clear the redis set version of the cache on
the new machine.
This commit ensures that, in 12.3, both set and non-set versions of the
cache are invalidated, but does not write or consult the set version of
the cache. . In 12.4, it will be safe to switch branch and tag names to
the redis set cache both it and the legacy cache will be invalidated
appropriately in such a mixed code environment.
This delays the full implementation of the feature by one release, but
in the absence of a credible feature-flagging strategy, and amidst an
abundance of caution about the effects of too-eager cache expiration, I
believe this is the best approach available to us.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 6ed89ed2c32..e5a83366776 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -239,13 +239,13 @@ class Repository def branch_exists?(branch_name) return false unless raw_repository - branch_names_include?(branch_name) + branch_names.include?(branch_name) end def tag_exists?(tag_name) return false unless raw_repository - tag_names_include?(tag_name) + tag_names.include?(tag_name) end def ref_exists?(ref) @@ -569,10 +569,10 @@ class Repository end delegate :branch_names, to: :raw_repository - cache_method_as_redis_set :branch_names, fallback: [] + cache_method :branch_names, fallback: [] delegate :tag_names, to: :raw_repository - cache_method_as_redis_set :tag_names, fallback: [] + cache_method :tag_names, fallback: [] delegate :branch_count, :tag_count, :has_visible_content?, to: :raw_repository cache_method :branch_count, fallback: 0 |