Enable `efficient_counter_attribute` feature flag

Problem to solve

Resolving bug #23327 (closed) requires multiple steps and this issue is for one of them to enable efficient_counter_attribute feature flag.

Intended users

User experience goal

Proposal

Enable efficient_counter_attribute feature flag and monitor it to confirm the CounterAttribute Rails concern is properly incrementing/decrementing build_artifacts_size.

What does success look like, and how can we measure that?

  • statistics for build artifacts size are updated correctly (with efficient counters there is up to 10 mins delay when the size is reflected in the database)

    • Add multiple artifacts
    • Remove multiple artifacts
    • ensure the artifacts size matches the expectation
  • Monitor FlushCounterIncrementsWorker in Grafana to ensure it works fine and it's scheduled regularly.

  • Redis usage to remain low - we need to ensure that we are not storing too much data and that FlushCounterIncrementsWorker moves data from Redis to the database regularly.

  • Additionally we could check whether any of the statement timeout related to project_statistics and namespace_statistics updates are reduced.

Further details

This issue is for step 2 in the following plan of action to fix artifact_size being broken (#23327 (closed)):

  1. Make build_artifacts_size use efficient counters - #238534 (closed)
  2. Enable efficient_counter_attribute feature flag and monitor it - #238535 (closed)
  3. Fix decrement of build_artifact_size when artifacts are deleted when a pipeline is deleted - #23327 (closed)
  4. Write a script that can forcefully recalculate all artifacts size - #238536 (closed)

Permissions and Security

Documentation

Availability & Testing

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Edited by Fabio Pitino - PTO until Jan 1