diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-20 00:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-20 00:09:01 +0300 |
commit | 8acf72a1d95677e37ca2c3a8bea3e65139443527 (patch) | |
tree | dcb7f53c394ff29b5bee9bc1a60f19c4cda29b40 /doc | |
parent | 91aa6c6479ec883328ae656ab70d6fc3824b5673 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/administration/raketasks/maintenance.md | 55 | ||||
-rw-r--r-- | doc/ci/secrets/id_token_authentication.md | 4 | ||||
-rw-r--r-- | doc/update/background_migrations.md | 26 |
3 files changed, 38 insertions, 47 deletions
diff --git a/doc/administration/raketasks/maintenance.md b/doc/administration/raketasks/maintenance.md index 06f7203f695..50c4b004f9c 100644 --- a/doc/administration/raketasks/maintenance.md +++ b/doc/administration/raketasks/maintenance.md @@ -350,37 +350,54 @@ status in the output of the `sudo gitlab-rake db:migrate:status` command. sudo gitlab-ctl restart sidekiq ``` -## Rebuild database indexes +## Rebuild database indexes (Experiment) WARNING: -This is an experimental feature that isn't enabled by default. It requires PostgreSQL 12 or later. +This feature is experimental, and isn't enabled by default. Use caution when +running in a production environment, and run during off-peak times. -Database indexes can be rebuilt regularly to reclaim space and maintain healthy levels of index bloat over time. +Database indexes can be rebuilt regularly to reclaim space and maintain healthy +levels of index bloat over time. Reindexing can also be run as a +[regular cron job](https://docs.gitlab.com/omnibus/settings/database.html#automatic-database-reindexing). +A "healthy" level of bloat is highly dependent on the specific index, but generally +should be below 30%. -To rebuild the two indexes with the highest estimated bloat, use the following Rake task: +Prerequisites: -```shell -sudo gitlab-rake gitlab:db:reindex -``` +- This feature requires PostgreSQL 12 or later. +- These index types are not supported: expression indexes, partitioned indexes, + and indexes used for constraint exclusion. -To target a specific index, use the following Rake task: +To manually rebuild a database index: -```shell -sudo gitlab-rake gitlab:db:reindex['public.a_specific_index'] -``` +1. Optional. To send annotations to a Grafana (4.6 or later) endpoint, enable annotations + with these custom environment variables (see [setting custom environment variables](https://docs.gitlab.com/omnibus/settings/environment-variables.html)): + + 1. `GRAFANA_API_URL`: The base URL for Grafana, such as `http://some-host:3000`. + 1. `GRAFANA_API_KEY`: A Grafana API key with at least `Editor role`. + +1. Run the Rake task to rebuild the two indexes with the highest estimated bloat: + + ```shell + sudo gitlab-rake gitlab:db:reindex + ``` -The following index types are not supported: +1. The reindexing task (`gitlab:db:reindex`) rebuilds only the two indexes in each database + with the highest bloat. To rebuild more than two indexes, run the task again + until all desired indexes have been rebuilt. -1. Indexes used for constraint exclusion -1. Partitioned indexes -1. Expression indexes +### Notes -Optionally, this Rake task sends annotations to a Grafana (4.6 or later) endpoint. Use the following custom environment variables to enable annotations: +- Rebuilding database indexes is a disk-intensive task, so you should perform the +task during off-peak hours. Running the task during peak hours can lead to +_increased_ bloat, and can also cause certain queries to perform slowly. -1. `GRAFANA_API_URL` - The base URL for Grafana, for example `http://some-host:3000`. -1. `GRAFANA_API_KEY` - Grafana API key with at least `Editor role`. +- The task requires free disk space for the index being restored. The created +indexes are appended with `_ccnew`. If the reindexing task fails, re-running the +task cleans up the temporary indexes. -You can also [enable reindexing as a regular cron job](https://docs.gitlab.com/omnibus/settings/database.html#automatic-database-reindexing). +- The time it takes for database index rebuilding to complete depends on the size +of the target database. It can take between several hours and several days. ## Import common metrics diff --git a/doc/ci/secrets/id_token_authentication.md b/doc/ci/secrets/id_token_authentication.md index 58bdfc7e603..12e0402be25 100644 --- a/doc/ci/secrets/id_token_authentication.md +++ b/doc/ci/secrets/id_token_authentication.md @@ -74,8 +74,6 @@ The token also includes custom claims provided by GitLab: | `runner_id` | Always | ID of the runner executing the job. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/404722) in GitLab 16.0. | | `runner_environment` | Always | The type of runner used by the job. Can be either `gitlab-hosted` or `self-hosted`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/404722) in GitLab 16.0. | | `sha` | Always | The commit SHA for the job. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/404722) in GitLab 16.0. | -| `pipeline_ref` | Always | Fully qualified URL for the pipeline definition (e.g. `https://gitlab.example.com/my-group/my-project/-/blob/714a629c0b401fdce83e847fc9589983fc6f46bc/.gitlab-ci.yml`). Might point to a remote location [depending on project configuration](../pipelines/settings.md#specify-a-custom-cicd-configuration-file). | -| `pipeline_sha` | Always | Git commit SHA for the project where the pipeline definition is stored. Only populated when the pipeline definition is stored in the project running the job. | ```json { @@ -103,8 +101,6 @@ The token also includes custom claims provided by GitLab: "runner_id": 1, "runner_environment": "self-hosted", "sha": "714a629c0b401fdce83e847fc9589983fc6f46bc", - "pipeline_ref": "https://gitlab.example.com/my-group/my-project/-/blob/714a629c0b401fdce83e847fc9589983fc6f46bc/.gitlab-ci.yml", - "pipeline_sha": "714a629c0b401fdce83e847fc9589983fc6f46bc", "jti": "235b3a54-b797-45c7-ae9a-f72d7bc6ef5b", "iss": "https://gitlab.example.com", "iat": 1681395193, diff --git a/doc/update/background_migrations.md b/doc/update/background_migrations.md index be6ad43fa8a..581bd5ff32a 100644 --- a/doc/update/background_migrations.md +++ b/doc/update/background_migrations.md @@ -207,11 +207,8 @@ Feature.disable(:optimize_batched_migrations) > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104027) > in GitLab 15.7, [behind a feature flag](../user/feature_flags.md), -> [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/372316). -> - Enabled on GitLab.com. -> - Recommended for production use. -> - For GitLab self-managed instances, GitLab administrators can opt to -> [disable it](#enable-or-disable-parallel-execution-for-batched-background-migrations). +> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/372316) in GitLab 15.11. +> - Feature flag `batched_migrations_parallel_execution` removed in GitLab 16.1. There can be [risks when disabling released features](../administration/feature_flags.md#risks-when-disabling-released-features). Refer to this feature's version history for more details. @@ -225,25 +222,6 @@ the number of batched background migrations executed in parallel: ApplicationSetting.update_all(database_max_running_batched_background_migrations: 4) ``` -#### Enable or disable parallel execution for batched background migrations - -Parallel execution for batched background migrations is under development but ready for production use. -It is deployed behind a feature flag that is **enabled by default**. -[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md) -can opt to disable it. - -To enable it: - -```ruby -Feature.enable(:batched_migrations_parallel_execution) -``` - -To disable it: - -```ruby -Feature.disable(:batched_migrations_parallel_execution) -``` - ## Troubleshooting ### Enable or disable background migrations |