Skip to content

WIP: Optimize `GitalyClient.feature_enabled?`

Kim Carlbäcker requested to merge gitaly-feature-on-early-return into master

What does this MR do?

  • Don't run Random.rand() if we're at 100% (Gitaly only)
    100 < 100 is always false so we might be hitting NFS here even at 100% if Random.rand() returns 1 ...
  • Reset the percentage when setting the feature to 100%/true (ALL Features...)
    Previously when a feature was at 50%, !feature-set feature true did nothing since the PercentageGate wasn't being reset.
  • Enable a feature if set to a percentage.

Are there points in the code the reviewer needs to double check?

The percentage reset in the API-change could probably need an extra eye. Not sure who to ping.

Why was this MR needed?

Annoyance, mainly 🤷

Does this MR meet the acceptance criteria?

Edited by Kim Carlbäcker

Merge request reports