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
85cc12e7
Commit
85cc12e7
authored
Nov 08, 2021
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove upper index size limit for reindexing
Relates to
https://gitlab.com/gitlab-org/gitlab/-/issues/345134
parent
9659e770
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/database/reindexing/index_selection.rb
lib/gitlab/database/reindexing/index_selection.rb
+3
-3
spec/lib/gitlab/database/reindexing/index_selection_spec.rb
spec/lib/gitlab/database/reindexing/index_selection_spec.rb
+3
-3
No files found.
lib/gitlab/database/reindexing/index_selection.rb
View file @
85cc12e7
...
...
@@ -9,8 +9,8 @@ module Gitlab
# Only reindex indexes with a relative bloat level (bloat estimate / size) higher than this
MINIMUM_RELATIVE_BLOAT
=
0.2
# Only consider indexes
with a total ondisk size in this rang
e (before reindexing)
INDEX_SIZE_
RANGE
=
(
1
.
gigabyte
..
100
.
gigabyte
).
freez
e
# Only consider indexes
beyond this siz
e (before reindexing)
INDEX_SIZE_
MINIMUM
=
1
.
gigabyt
e
delegate
:each
,
to: :indexes
...
...
@@ -32,7 +32,7 @@ module Gitlab
@indexes
||=
candidates
.
not_recently_reindexed
.
where
(
ondisk_size_bytes:
INDEX_SIZE_RANGE
)
.
where
(
'ondisk_size_bytes >= ?'
,
INDEX_SIZE_MINIMUM
)
.
sort_by
(
&
:relative_bloat_level
)
# forced N+1
.
reverse
.
select
{
|
candidate
|
candidate
.
relative_bloat_level
>=
MINIMUM_RELATIVE_BLOAT
}
...
...
spec/lib/gitlab/database/reindexing/index_selection_spec.rb
View file @
85cc12e7
...
...
@@ -46,14 +46,14 @@ RSpec.describe Gitlab::Database::Reindexing::IndexSelection do
expect
(
subject
).
not_to
include
(
excluded
.
index
)
end
it
'
ex
cludes indexes larger than 100 GB ondisk size'
do
ex
cluded
=
create
(
it
'
in
cludes indexes larger than 100 GB ondisk size'
do
in
cluded
=
create
(
:postgres_index_bloat_estimate
,
index:
create
(
:postgres_index
,
ondisk_size_bytes:
101
.
gigabytes
),
bloat_size_bytes:
25
.
gigabyte
)
expect
(
subject
).
not_to
include
(
ex
cluded
.
index
)
expect
(
subject
).
to
include
(
in
cluded
.
index
)
end
context
'with time frozen'
do
...
...
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