summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-11-11 18:32:40 +0000
committerDouwe Maan <douwe@gitlab.com>2016-11-11 18:32:40 +0000
commit0e1e42885a792145dafc6aa28165d069b1cb5c03 (patch)
tree2748dddbf1f499ff9be1eca4ce6a8132f44649a1 /db
parent52f29501be343ed8cb8bfc8ee64014cd3f4c9ba4 (diff)
parente840749b84ceb226e46ebdfb489c735e3370cff7 (diff)
downloadgitlab-ce-0e1e42885a792145dafc6aa28165d069b1cb5c03.tar.gz
Merge branch 'sidekiq-job-throttling' into 'master'
Allow certain Sidekiq jobs to be throttled ## What does this MR do? Allows certain slow running Sidekiq jobs to be throttled. It is disabled by default and can be enabled via the Application Settings. ![Screen_Shot_2016-11-04_at_4.51.24_PM](/uploads/a1f1d24c693fcdb278602765cd404d94/Screen_Shot_2016-11-04_at_4.51.24_PM.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - Tests - [x] Added for this feature/bug - [x] All builds are passing ## What are the relevant issue numbers? Related to #23352 See merge request !7292
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb31
-rw-r--r--db/schema.rb3
2 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb b/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb
new file mode 100644
index 00000000000..e644a174964
--- /dev/null
+++ b/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb
@@ -0,0 +1,31 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddSidekiqThrottlingToApplicationSettings < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ # When a migration requires downtime you **must** uncomment the following
+ # constant and define a short and easy to understand explanation as to why the
+ # migration requires downtime.
+ # DOWNTIME_REASON = ''
+
+ # When using the methods "add_concurrent_index" or "add_column_with_default"
+ # you must disable the use of transactions as these methods can not run in an
+ # existing transaction. When using "add_concurrent_index" make sure that this
+ # method is the _only_ method called in the migration, any other changes
+ # should go in a separate migration. This ensures that upon failure _only_ the
+ # index creation fails and can be retried or reverted easily.
+ #
+ # To disable transactions uncomment the following line and remove these
+ # comments:
+ # disable_ddl_transaction!
+
+ def change
+ add_column :application_settings, :sidekiq_throttling_enabled, :boolean, default: false
+ add_column :application_settings, :sidekiq_throttling_queues, :string
+ add_column :application_settings, :sidekiq_throttling_factor, :decimal
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 64d744d8268..3efb884c113 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -98,6 +98,9 @@ ActiveRecord::Schema.define(version: 20161109150329) do
t.text "help_page_text_html"
t.text "shared_runners_text_html"
t.text "after_sign_up_text_html"
+ t.boolean "sidekiq_throttling_enabled", default: false
+ t.string "sidekiq_throttling_queues"
+ t.decimal "sidekiq_throttling_factor"
t.boolean "housekeeping_enabled", default: true, null: false
t.boolean "housekeeping_bitmaps_enabled", default: true, null: false
t.integer "housekeeping_incremental_repack_period", default: 10, null: false