Skip to content

Delete old (non-latest) merge request diff files after merge

At the moment, we store the full (diff) text of every revision on every MR. That takes a lot of space!

We can keep the merge_request_diffs and merge_request_diff_commits rows, but delete the merge_request_diff_files, which are big: https://gitlab.com/gitlab-org/gitlab-ce/issues/37632#note_61739587

They only appear to be used on the changes tab: https://gitlab.com/gitlab-org/gitlab-ce/issues/37639#note_61272560

Things we need to check:

  1. Is there any other place where these are used? If so, we should re-evaluate.
  2. When should we remove the older versions of the files? In https://gitlab.com/gitlab-org/gitlab-ce/issues/37639 we said we could remove them after merging, but I think we could just stop keeping them anyway.
  3. Is there a performance concern with hitting the repository here? I don't think so, as explained above, but we shouldn't just take my word for it!
Edited by Sean McGivern