Skip to content

Apply Cost Factor for Forks to Total Namespace Storage

What does this MR do and why?

Apply a cost factor for forks to the total namespace storage consumed by namespaces.

This MR applies the cost factor to Namespaces::Storage::RootSize#current_size. This function is used in storage size checks such as RootSize#above_size_limit? and RootSize#exceeded_size?. This will mean that cost factors for forks will apply to most namespace storage size limit checks. The one exception is git push operations which will be taken care of in https://gitlab.com/gitlab-org/gitlab/-/issues/393586+.

This MR uses a cost factor of 1.0 as a place holder so that there will be no effective changes in actual behavior for now.

The cost factor is not applied to the reported total namespace storage as seen on the Usage quotas page. See the note in this async update:

The Namespace storage used as reported on the Usage quotas page (see screenshots below) does not appear to use Namespaces::Storage::RootSize#current_size, but rather directly references Namespace::RootStorageStatistics#storage_size. At least for the purposes of !122245 (merged), this works out well, because the MR won't change the displayed value on the Usage quotas page right away.

This probably needs to change, but will be handled in https://gitlab.com/gitlab-org/gitlab/-/issues/393580+.

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/399371

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jason Goodman

Merge request reports

Loading