Use objectsize:diskusage for catfile repository size calculation
In !4797 (merged), we switched to using git cat-file
to calculate the repository size for performance reasons. The reason for this change was discussed in gitlab#368150 (closed).
However, in calculating the size with cat-file
, we did not use the objectsize:diskusage
formatting flag--which means that delta compression was not taken into account. This resulted in much larger repository sizes when we rolled it into production leading to an incident.
We need to fix the RepositorySize
RPC by adding the objectsize:diskusage
flag. But also, since this is a high risk change we should gate it with a second feature flag before actually returning the results. When this second feature flag is turned off, we will simply calculate the size with both du
and cat-file
and log the results so we can have a period of observability and monitoring before actually returning the new calculated result to rails.