Commit Graph

20 Commits

Author SHA1 Message Date
GitLab Bot e689e858ed Add latest changes from gitlab-org/gitlab@master 2020-05-13 18:08:47 +00:00
GitLab Bot 88a0824944 Add latest changes from gitlab-org/gitlab@master 2020-02-04 12:09:00 +00:00
GitLab Bot b1ffdbb7f9 Add latest changes from gitlab-org/gitlab@master 2019-11-14 21:06:14 +00:00
GitLab Bot e464f195ff Add latest changes from gitlab-org/gitlab@master 2019-10-14 12:06:14 +00:00
GitLab Bot 3744bcc0d1 Add latest changes from gitlab-org/gitlab@master 2019-10-09 09:06:19 +00:00
Thong Kuah 85b29c1c2f Add frozen_string_literal to spec/services
Probably useful as we often move these files to "new" files.
2019-04-12 10:14:54 +12:00
Gabriel Mazetto b4f2050207 Skip project validation when switching storage layouts
This is a fix for the Hashed Storage migration and Rollback procedure
to ignore any project-level validation error that can happen in a
long-running instance.

There are many situations where defaults and acceptable values changed
but, because we didn't provide a migration to "valid" attributes, it
can happen that project will not be `valid? => true`.

Because the changes we are making are limited to setting a project as
read_only or changing the storage_level, it's safe to bypass validation.
2019-03-05 04:00:53 +01:00
Gabriel Mazetto 264394f6d3 Extract and simplify more code into BaseRepositoryService`
`try_to_set_repository_read_only!` is now on the Base class.
Simplified Exception classes from 2 to 1 with a more descriptive name.
2019-03-01 15:49:20 +01:00
Gabriel Mazetto 4bae61005d Edge case: upgrade/downgrade when repository doesn't exist
This change takes the case where repository doesn't exist on disk
and make it ignore but succeed the step, increasing or decreasing the
version depending on the operation.
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 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
Alejandro Rodríguez a99bf447a2 Remove Gitlab::Git::Repository#rugged and Gollum code
Cleanup code, and refactor tests that still use Rugged. After this, there should
be no Rugged code that access the instance's repositories on non-test
environments. There is still some rugged code for other tasks like the
repository import task, but since it doesn't access any repository storage path
it can stay.
2018-10-02 16:34:28 -03:00
Valery Sizov 10df0eb7cb Resolve "Hashed storage: extend "Enable hashed storage for all new projects" to "for all new and renamed projects"" 2018-08-03 14:34:28 +00:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
Zeger-Jan van de Weg ec4423665c
Gitlab::Shell works on shard name, not path
Direct disk access is done through Gitaly now, so the legacy path was
deprecated. This path was used in Gitlab::Shell however. This required
the refactoring in this commit.

Added is the removal of direct path access on the project model, as that
lookup wasn't needed anymore is most cases.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-25 13:36:22 +02:00
Nick Thomas 6b0c6e69e1
Use hashed storage in the specs 2018-02-07 13:40:46 +00:00
Jacob Vosmaer 5d1391b681 Fix specs 2018-01-05 12:29:01 +01:00
Douglas Barbosa Alexandre 2f2233774c Write project full path to .git/config when migrating legacy storage 2018-01-03 16:13:31 -02:00
Gabriel Mazetto 4b87c1afaa when rollingback repository migration, toggle readonly mode back 2017-11-23 14:19:36 +01:00
Gabriel Mazetto 0a4d55a1c9 Refactor Hashed Storage migration to add additional migration steps 2017-11-23 14:19:36 +01:00