Skip to content
代码片段 群组 项目
未验证 提交 35d0330f 编辑于 作者: Phillip Wells's avatar Phillip Wells 提交者: GitLab
浏览文件

Merge branch 'dnldnz-geo-troubleshooting-update' into 'master'

Update ProjectRegistry references to ProjectRepositoryRegistry and new methods

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167448



Merged-by: default avatarPhillip Wells <pwells@gitlab.com>
Approved-by: default avatarPhillip Wells <pwells@gitlab.com>
Reviewed-by: default avatarMichael Kozono <mkozono@gitlab.com>
Co-authored-by: default avatarDaniel Diniz <8012210-dnldnz@users.noreply.gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -223,14 +223,24 @@ to transfer each affected repository from the primary to the secondary site.
## Project or project wiki repositories
### Find repository verification failures
### Resync all Geo-replicable objects
You can schedule a full resync or reverification of all Geo-replicable objects
from the UI:
1. On the left sidebar, at the bottom, select **Admin**.
1. Select **Geo > Sites**.
1. Under **Replication details**, select the desired object.
1. Select **Resync all** or **Reverify all**.
[Start a Rails console session](../../../../administration/operations/rails_console.md#starting-a-rails-console-session)
**on the secondary Geo site** to gather more information.
Alternatively, [start a Rails console session](../../../../administration/operations/rails_console.md#starting-a-rails-console-session)
**on the secondary Geo site** to gather more information, or execute these operations manually using the snippets below.
WARNING:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
### Find repository verification failures
#### Get the number of verification failed repositories
```ruby
......@@ -249,20 +259,34 @@ Geo::ProjectRepositoryRegistry.verification_failed
Geo::ProjectRepositoryRegistry.failed
```
### Resync project and project wiki repositories
#### Mark all repositories for reverification
[Start a Rails console session](../../../../administration/operations/rails_console.md#starting-a-rails-console-session)
**on the secondary Geo site** to perform the following changes.
The following snippet marks all project repositories for reverification. After a minute or two, the system should begin to schedule Sidekiq jobs according to your concurrency limits:
WARNING:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
```ruby
Geo::ProjectRepositoryRegistry.update_all(verification_state: 0)
```
If there's a very large number of repositories to reverify, the single update query can time out. If this happens, you should run update queries in batches of rows using the same code as the **Reverify all** feature in the admin area:
```ruby
::Geo::RegistryBulkUpdateService.new(:reverify_all, Geo::ProjectRepositoryRegistry).execute
```
### Resync project and project wiki repositories
#### Queue up all repositories for resync
When you run this, the sync is handled in the background by Sidekiq.
The following snippet marks all project repositories for reverification. After a minute or two, the system should begin to schedule Sidekiq jobs according to your concurrency limits:
```ruby
Geo::ProjectRepositoryRegistry.update_all(state: 0, last_synced_at: nil)
```
If there's a very large number of repositories to reverify, the single update query can time out. If this happens, you should run update queries in batches of rows using the same code as the **Reverify all** feature in the admin area:
```ruby
Geo::ProjectRegistry.update_all(resync_repository: true, resync_wiki: true)
::Geo::RegistryBulkUpdateService.new(:resync_all, Geo::ProjectRepositoryRegistry).execute
```
#### Sync individual repository now
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册