Protected branches cache creates duplicated keys
Related to !92922 (merged)
Problem
I noticed that ProjectPresenter
records were additionally created for each protected branch cache.
redis.scan_each.to_a.select { |a| a.include? 'protected_branch' }
=> ["cache:gitlab:protected_branch:ProjectPresenter:6",
"cache:gitlab:protected_branch:Project:57",
"cache:gitlab:protected_branch:Project:6",
"cache:gitlab:protected_branch:ProjectPresenter:57"]
Both cache:gitlab:protected_branch:ProjectPresenter:6
and cache:gitlab:protected_branch:Project:6
should have the same data. This duplication only consumes extra spaces from Redis.
Suggestion
We need to update redis_key
generation logic to avoid duplication of keys.