Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
74c35852
Commit
74c35852
authored
Sep 29, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle elastic:reindex_cluster unique violation
parent
c22d662c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
ee/changelogs/unreleased/fix-cluster-reindexing-task.yml
ee/changelogs/unreleased/fix-cluster-reindexing-task.yml
+5
-0
ee/lib/tasks/gitlab/elastic.rake
ee/lib/tasks/gitlab/elastic.rake
+11
-5
No files found.
ee/changelogs/unreleased/fix-cluster-reindexing-task.yml
0 → 100644
View file @
74c35852
---
title
:
Gracefully handle gitlab:elastic:reindex_cluster unique index violation
merge_request
:
43690
author
:
type
:
fixed
ee/lib/tasks/gitlab/elastic.rake
View file @
74c35852
...
@@ -91,11 +91,7 @@ namespace :gitlab do
...
@@ -91,11 +91,7 @@ namespace :gitlab do
desc
"GitLab | Elasticsearch | Zero-downtime cluster reindexing"
desc
"GitLab | Elasticsearch | Zero-downtime cluster reindexing"
task
reindex_cluster: :environment
do
task
reindex_cluster: :environment
do
Elastic
::
ReindexingTask
.
create!
trigger_cluster_reindexing
ElasticClusterReindexingCronWorker
.
perform_async
puts
"Reindexing job was successfully scheduled"
.
color
(
:green
)
end
end
desc
"GitLab | Elasticsearch | Clear indexing status"
desc
"GitLab | Elasticsearch | Clear indexing status"
...
@@ -137,6 +133,16 @@ namespace :gitlab do
...
@@ -137,6 +133,16 @@ namespace :gitlab do
count
count
end
end
def
trigger_cluster_reindexing
Elastic
::
ReindexingTask
.
create!
ElasticClusterReindexingCronWorker
.
perform_async
puts
'Reindexing job was successfully scheduled'
.
color
(
:green
)
rescue
PG
::
UniqueViolation
,
ActiveRecord
::
RecordNotUnique
puts
'There is another task in progress. Please wait for it to finish.'
.
color
(
:red
)
end
def
display_unindexed
(
projects
)
def
display_unindexed
(
projects
)
arr
=
if
projects
.
count
<
500
||
ENV
[
'SHOW_ALL'
]
arr
=
if
projects
.
count
<
500
||
ENV
[
'SHOW_ALL'
]
projects
projects
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment