Add ClusterRateLimiting for Redis Cluster migration
What does this MR do and why?
This MR adds Gitlab::Redis::ClusterRateLimiting which contains a MultiStore object of primary: ClusterRateLimiting (reads config/redis.cluster_rate_limiting.yml) and secondary: RateLimiting.
Only 2 components use Gitlab::Redis::RateLimiting:
-
Gitlab::ApplicationRateLimiter::BaseStrategy: updatewith_redisto toggle between 2 stores via feature flag -
Gitlab::RackAttack::InstrumentedCacheStorevia a Rails.cache store: DefineRateLimitingMigratorand createRedisCacheStoreusing it
Why: Scalability team is migrating rate-limiting operations from redis-ratelimiting (redis sentinel) to a Redis Cluster setup.
See issue for more info: gitlab-com/gl-infra/scalability#2036
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sylvester Chin