Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/merge_request_concepts/diffs/development.md')
-rw-r--r--doc/development/merge_request_concepts/diffs/development.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/development/merge_request_concepts/diffs/development.md b/doc/development/merge_request_concepts/diffs/development.md
index 1c22eff34db..37d87d4e4eb 100644
--- a/doc/development/merge_request_concepts/diffs/development.md
+++ b/doc/development/merge_request_concepts/diffs/development.md
@@ -72,6 +72,14 @@ contents, individual commits, and the files containing changes.
Diff content is usually accessed through this class. Logic is often applied
to diff, file, and commit content before it is returned to a user.
+#### `MergeRequestDiff#commits_count`
+
+When `MergeRequestDiff` is saved, associated `MergeRequestDiffCommit` records are
+counted and cached into the `commits_count` column. This number displays on the
+merge request page as the counter for the **Commits** tab.
+
+If `MergeRequestDiffCommit` records are deleted, the counter doesn't update.
+
### `MergeRequestDiffCommit`
`MergeRequestDiffCommit` is defined in `app/models/merge_request_diff_commit.rb`.
@@ -119,6 +127,23 @@ relationship to the change, such as:
- Its ordering in the diff.
- The raw diff output itself.
+#### External diff storage
+
+By default, diff data of a `MergeRequestDiffFile` is stored in `diff` column in
+the `merge_request_diff_files` table. On some installations, the table can grow
+too large, so they're configured to store diffs on external storage to save space.
+To configure it, see [Merge request diffs storage](../../../administration/merge_request_diffs.md).
+
+When configured to use external storage:
+
+- The `diff` column in the database is left `NULL`.
+- The associated `MergeRequestDiff` record sets the `stored_externally` attribute
+ to `true` on creation of `MergeRequestDiff`.
+
+A cron job named `ScheduleMigrateExternalDiffsWorker` is also scheduled at
+minute 15 of every hour. This migrates `diff` that are still stored in the
+database to external storage.
+
### `MergeRequestDiffDetail`
`MergeRequestDiffDetail` is defined in `app/models/merge_request_diff_detail.rb`.