Skip to content

Remove tempfile from external diff creation

What does this MR do?

In gitlab-com/gl-infra/scalability#348 (closed) , the fact that external diffs go through a tempfile was raised as a possible source of issues. In !35734 (merged) we move this work to be outside of the database transaction when migrating data, but we still go through the tempfile in-transaction when creating a new MR diff from scratch, or when migrating from external storage to database.

I think it's worthwhile to take the extra RAM hit here to avoid this source of slowness in these cases. It's more difficult to apply the out-of-transaction fix to them, since we're so much more tightly coupled to the ActiveRecord lifecycle in these cases. We have bounds on maximum diff size, and we're already loading them all into memory.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Part of #216458 (closed)

Edited by Oswaldo Ferreira

Merge request reports