Store slice multiplier and max slices running for reindexing in database
What does this MR do?
Related to #294210 (closed)
backend work required to allow admins to customize the reindexing process by choosing the max # of running slices and how many slices for the reindexing process. The frontend work will be completed in: !60730 (merged)
Highlight of changes:
- Store two new values in
elastic_reindexing_tasks
: Slice multiplier and Max slices running - Set default values for both fields if they are not provided (or set to nil)
- Update specs
Database
up
bundle exec rails db:migrate:up VERSION=20210430154631
== 20210430154631 AddSliceMultiplierAndMaxSlicesToElasticReindexingTask: migrating
-- add_column(:elastic_reindexing_tasks, :max_slices_running, :integer, {:limit=>2, :default=>60, :null=>false})
-> 0.0068s
-- add_column(:elastic_reindexing_tasks, :slice_multiplier, :integer, {:limit=>2, :default=>2, :null=>false})
-> 0.0013s
== 20210430154631 AddSliceMultiplierAndMaxSlicesToElasticReindexingTask: migrated (0.0082s)
down
bundle exec rails db:migrate:down VERSION=20210430154631
== 20210430154631 AddSliceMultiplierAndMaxSlicesToElasticReindexingTask: reverting
-- remove_column(:elastic_reindexing_tasks, :slice_multiplier, :integer, {:limit=>2, :default=>2, :null=>false})
-> 0.0110s
-- remove_column(:elastic_reindexing_tasks, :max_slices_running, :integer, {:limit=>2, :default=>60, :null=>false})
-> 0.0009s
== 20210430154631 AddSliceMultiplierAndMaxSlicesToElasticReindexingTask: reverted (0.0148s)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Terri Chu