We have various places where we want to count things.
- For example, we keep track of number of repositories and wikis in
site_statistics. However, the implementation here is not efficient because all requests that change the count are serialized on this one record.
- The usage ping requires a lot of counting
- We're adding more counting every now and then, e.g. in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22007.
The proposal here is to provide an efficient implementation of exact counters. By exact, we mean consistent with the postgres database (MVCC compatible).
A concrete proposal of how to implement this efficiently can be found in https://gitlab.com/gitlab-org/gitlab-ce/issues/50401#note_98576180.
This issue is currently blocking:
- All groups from adding useful usage ping statstics
- https://gitlab.com/gitlab-org/gitlab-ce/issues/29288 in ~Verify
- https://gitlab.com/gitlab-org/gitlab-ce/issues/51722 in ~Verify
- https://gitlab.com/gitlab-org/gitlab-ce/issues/53325 in ~Verify
- https://gitlab.com/gitlab-org/gitlab-ee/issues/10396 in ~Geo