Commit Graph

15 Commits

Author SHA1 Message Date
GitLab Bot afed1a4be1 Add latest changes from gitlab-org/gitlab@master 2020-09-17 09:09:32 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot df2eda3f14 Add latest changes from gitlab-org/gitlab@master 2020-02-20 18:08:51 +00:00
GitLab Bot 76623c12c1 Add latest changes from gitlab-org/gitlab@master 2020-02-05 21:09:02 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
Gabriel Mazetto 523712d116 Fix storage migration check for non-empty queues
The previous code works fine when running specs, but the API
does not exist outside that environment.
2019-03-17 00:27:38 +01:00
Gabriel Mazetto 337977776a Prevent storage migration and rollback running at the same time
This is a small polishing on the storage migration and storage rollback
rake tasks. By aborting a migration while a rollback is already
scheduled we want to prevent unexpected consequences.
2019-03-12 17:51:05 +01:00
Gabriel Mazetto fc0ff92807 Added Rollbacker workers and support on the rake task
Rollback is done similar to Migration for the Hashed Storage.
It also shares the same ExclusiveLease key to prevent both happening
at the same time.

All Hashed Storage related workers now share the same queue namespace
which allows for assigning dedicated workers easily.
2019-03-01 15:49:20 +01:00
Gabriel Mazetto d63380fa93 Refactor ProjectMigrate and ProjectRollback workers
Moved to HashedStorage namespace, and added them to the
`:hashed_storage` queue namespace
2019-03-01 15:49:20 +01:00
Gabriel Mazetto 1592b5830f Adds Rollback functionality to HashedStorage migration
We are adding sidekiq workers and service classes to allow to rollback
a hashed storage migration. There are some refactoring involved as well
as part of the code can be reused by both the migration and the rollback
logic.
2019-03-01 15:49:20 +01:00
Gabriel Mazetto 7bc16889df Refactor Storage Migration
Specs were reviewed and improved to better cover the current behavior.
There was some standardization done as well to facilitate the
implementation of the rollback functionality.

StorageMigratorWorker was extracted to HashedStorage namespace were
RollbackerWorker will live one as well.
2019-01-25 20:26:35 +01:00
Gabriel Mazetto c2c34eba62 Prepare rake task for storage rollback
We are keeping compatibility with existing scheduled jobs.
2019-01-25 20:26:35 +01:00
Gabriel Mazetto ee4af0c64c Only set as `read_only` when starting the per-project migration
In the previous code, we locked the project during the migration
scheduling step, which works fine for small setups, but can be
problematic in really big installations.

We now moved the logic to inside the worker, so we minimize the time a
project will be read-only. We also make sure we only do that if
reference counter is `0` (no current operation is in progress).
2019-01-07 23:53:06 +01:00
blackst0ne ddd2a25679 Replace 'Sidekiq::Testing.inline!' with 'perform_enqueued_jobs'
`perform_enqueued_jobs` is a Sidekiq method.
Using this method violates the Dependency inversion principle[0].

This commit replaces `perform_enqueued_jobs` with ActiveJob's abstract
method `perform_enqueued_jobs` in specs.

[0]: https://en.wikipedia.org/wiki/Dependency_inversion_principle
2018-07-23 15:34:54 +11:00
Gabriel Mazetto 36c3376475 Resolve "Hashed Storage: Make possible to migrate single project" 2018-06-07 15:40:44 +00:00