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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-14 11:41:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-14 11:41:52 +0300
commit585826cb22ecea5998a2c2a4675735c94bdeedac (patch)
tree5b05f0b30d33cef48963609e8a18a4dff260eab3 /doc/administration/merge_request_diffs.md
parentdf221d036e5d0c6c0ee4d55b9c97f481ee05dee8 (diff)
Add latest changes from gitlab-org/gitlab@16-6-stable-eev16.6.0-rc42
Diffstat (limited to 'doc/administration/merge_request_diffs.md')
-rw-r--r--doc/administration/merge_request_diffs.md117
1 files changed, 57 insertions, 60 deletions
diff --git a/doc/administration/merge_request_diffs.md b/doc/administration/merge_request_diffs.md
index 746dccb99d6..9c4ddcdc094 100644
--- a/doc/administration/merge_request_diffs.md
+++ b/doc/administration/merge_request_diffs.md
@@ -21,7 +21,9 @@ that only [stores outdated diffs](#alternative-in-database-storage) outside of d
## Using external storage
-For Linux package installations:
+::Tabs
+
+:::TabTitle Linux package (Omnibus)
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
@@ -41,7 +43,7 @@ For Linux package installations:
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect.
GitLab then migrates your existing merge request diffs to external storage.
-For self-compiled installations:
+:::TabTitle Self-compiled (source)
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines:
@@ -65,6 +67,8 @@ For self-compiled installations:
1. Save the file and [restart GitLab](restart_gitlab.md#self-compiled-installations) for the changes to take effect.
GitLab then migrates your existing merge request diffs to external storage.
+::EndTabs
+
## Using object storage
WARNING:
@@ -74,7 +78,9 @@ Instead of storing the external diffs on disk, we recommended the use of an obje
store like AWS S3 instead. This configuration relies on valid AWS credentials to
be configured already.
-For Linux package installations:
+::Tabs
+
+:::TabTitle Linux package (Omnibus)
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
@@ -86,7 +92,7 @@ For Linux package installations:
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect.
GitLab then migrates your existing merge request diffs to external storage.
-For self-compiled installations:
+:::TabTitle Self-compiled (source)
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines:
@@ -100,6 +106,8 @@ For self-compiled installations:
1. Save the file and [restart GitLab](restart_gitlab.md#self-compiled-installations) for the changes to take effect.
GitLab then migrates your existing merge request diffs to external storage.
+::EndTabs
+
[Read more about using object storage with GitLab](object_storage.md).
### Object Storage Settings
@@ -123,7 +131,9 @@ then `object_store:`. On Linux package installations, they are prefixed by
See [the available connection settings for different providers](object_storage.md#configure-the-connection-settings).
-For Linux package installations:
+::Tabs
+
+:::TabTitle Linux package (Omnibus)
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
the values you want:
@@ -153,7 +163,7 @@ For Linux package installations:
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect.
-For self-compiled installations:
+:::TabTitle Self-compiled (source)
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines:
@@ -173,6 +183,8 @@ For self-compiled installations:
1. Save the file and [restart GitLab](restart_gitlab.md#self-compiled-installations) for the changes to take effect.
+::EndTabs
+
## Alternative in-database storage
Enabling external diffs may reduce the performance of merge requests, as they
@@ -182,7 +194,9 @@ in the database.
To enable this feature, perform the following steps:
-For Linux package installations:
+::Tabs
+
+:::TabTitle Linux package (Omnibus)
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
@@ -192,7 +206,7 @@ For Linux package installations:
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation) for the changes to take effect.
-For self-compiled installations:
+:::TabTitle Self-compiled (source)
1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
lines:
@@ -205,6 +219,8 @@ For self-compiled installations:
1. Save the file and [restart GitLab](restart_gitlab.md#self-compiled-installations) for the changes to take effect.
+::EndTabs
+
With this feature enabled, diffs are initially stored in the database, rather
than externally. They are moved to external storage after any of these
conditions become true:
@@ -217,64 +233,45 @@ These rules strike a balance between space and performance by only storing
frequently-accessed diffs in the database. Diffs that are less likely to be
accessed are moved to external storage instead.
-## Correcting incorrectly-migrated diffs
-
-Versions of GitLab earlier than `v13.0.0` would incorrectly record the location
-of some merge request diffs when [external diffs in object storage](#object-storage-settings)
-were enabled. This mainly affected imported merge requests, and was resolved
-with [this merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31005).
-
-If you are using object storage, or have never used on-disk storage for external
-diffs, the **Changes** tab for some merge requests fails to load with a 500 error,
-and the exception for that error is of this form:
-
-```plain
-Errno::ENOENT (No such file or directory @ rb_sysopen - /var/opt/gitlab/gitlab-rails/shared/external-diffs/merge_request_diffs/mr-6167082/diff-8199789)
-```
-
-Then you are affected by this issue. Because it's not possible to safely determine
-all these conditions automatically, we've provided a Rake task in GitLab v13.2.0
-that you can run manually to correct the data:
-
-For Linux package installations:
-
-```shell
-sudo gitlab-rake gitlab:external_diffs:force_object_storage
-```
-
-For self-compiled installations:
+## Switching from external storage to object storage
-```shell
-sudo -u git -H bundle exec rake gitlab:external_diffs:force_object_storage RAILS_ENV=production
-```
+Automatic migration moves diffs stored in the database, but it does not move diffs between storage types.
+To switch from external storage to object storage:
-Environment variables can be provided to modify the behavior of the task. The
-available variables are:
+1. Move files stored on local or NFS storage to object storage manually.
+1. Run this Rake task to change their location in the database.
-| Name | Default value | Purpose |
-| ---- | ------------- | ------- |
-| `ANSI` | `true` | Use ANSI escape codes to make output more understandable |
-| `BATCH_SIZE` | `1000` | Iterate through the table in batches of this size |
-| `START_ID` | `nil` | If set, begin scanning at this ID |
-| `END_ID` | `nil` | If set, stop scanning at this ID |
-| `UPDATE_DELAY` | `1` | Number of seconds to sleep between updates |
+ For Linux package installations:
-The `START_ID` and `END_ID` variables may be used to run the update in parallel,
-by assigning different processes to different parts of the table. The `BATCH`
-and `UPDATE_DELAY` parameters allow the speed of the migration to be traded off
-against concurrent access to the table. The `ANSI` parameter should be set to
-false if your terminal does not support ANSI escape codes.
+ ```shell
+ sudo gitlab-rake gitlab:external_diffs:force_object_storage
+ ```
-By default, `sudo` does not preserve existing environment variables. You should append them, rather than prefix them.
+ For self-compiled installations:
-```shell
-sudo gitlab-rake gitlab:external_diffs:force_object_storage START_ID=59946109 END_ID=59946109 UPDATE_DELAY=5
-```
+ ```shell
+ sudo -u git -H bundle exec rake gitlab:external_diffs:force_object_storage RAILS_ENV=production
+ ```
-## Switching from external storage to object storage
+ By default, `sudo` does not preserve existing environment variables. You should
+ append them, rather than prefix them, like this:
-Automatic migration moves diffs stored in the database, but it does not move diffs between storage types.
-To switch from external storage to object storage:
+ ```shell
+ sudo gitlab-rake gitlab:external_diffs:force_object_storage START_ID=59946109 END_ID=59946109 UPDATE_DELAY=5
+ ```
-1. Move files stored on local or NFS storage to object storage manually.
-1. Run the Rake task in the [previous section](#correcting-incorrectly-migrated-diffs) to change their location in the database.
+These environment variables modify the behavior of the Rake task:
+
+| Name | Default value | Purpose |
+|----------------|---------------|---------|
+| `ANSI` | `true` | Use ANSI escape codes to make output more understandable. |
+| `BATCH_SIZE` | `1000` | Iterate through the table in batches of this size. |
+| `START_ID` | `nil` | If set, begin scanning at this ID. |
+| `END_ID` | `nil` | If set, stop scanning at this ID. |
+| `UPDATE_DELAY` | `1` | Number of seconds to sleep between updates. |
+
+- `START_ID` and `END_ID` can be used to run the update in parallel,
+ by assigning different processes to different parts of the table.
+- `BATCH` and `UPDATE_DELAY` enable the speed of the migration to be traded off
+ against concurrent access to the table.
+- `ANSI` should be set to `false` if your terminal does not support ANSI escape codes.