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
c0b4f8ac
Commit
c0b4f8ac
authored
Apr 27, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove legacy artifacts file_store migration
parent
76f0d7fe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
72 deletions
+6
-72
db/post_migrate/20180424151928_fill_file_store.rb.rb
db/post_migrate/20180424151928_fill_file_store.rb.rb
+6
-30
lib/gitlab/background_migration/fill_file_store_build_archive.rb
...lab/background_migration/fill_file_store_build_archive.rb
+0
-21
lib/gitlab/background_migration/fill_file_store_build_metadata.rb
...ab/background_migration/fill_file_store_build_metadata.rb
+0
-21
No files found.
db/post_migrate/20180424151928_fill_file_store.rb.rb
View file @
c0b4f8ac
...
@@ -5,28 +5,6 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -5,28 +5,6 @@ class FillFileStore < ActiveRecord::Migration
disable_ddl_transaction!
disable_ddl_transaction!
class
Build
<
ActiveRecord
::
Base
include
EachBatch
self
.
table_name
=
'ci_builds'
BATCH_SIZE
=
10_000
def
self
.
queue_background_migration
self
.
class
.
where
(
artifacts_file_store:
nil
).
tap
do
|
relation
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
'FillFileStoreBuildArchive'
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
self
.
class
.
where
(
artifacts_metadata_store:
nil
).
tap
do
|
relation
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
'FillFileStoreBuildMetadata'
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
end
end
class
JobArtifact
<
ActiveRecord
::
Base
class
JobArtifact
<
ActiveRecord
::
Base
include
EachBatch
include
EachBatch
self
.
table_name
=
'ci_job_artifacts'
self
.
table_name
=
'ci_job_artifacts'
...
@@ -75,15 +53,13 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -75,15 +53,13 @@ class FillFileStore < ActiveRecord::Migration
def
up
def
up
disable_statement_timeout
disable_statement_timeout
# Schedule background migrations that fill 'NULL' value by '1' on `file_store`, `store`, `artifacts_file_store` columns
# NOTE: Schedule background migrations that fill 'NULL' value by '1'(ObjectStorage::Store::LOCAL) on `file_store`, `store` columns
# '1' represents ObjectStorage::Store::LOCAL
#
# ci_builds.artifacts_file_store
# Here are the target columns
# ci_builds.artifacts_metadata_store
# - ci_job_artifacts.file_store
# ci_job_artifacts.file_store
# - lfs_objects.file_store
# lfs_objects.file_store
# - uploads.store
# uploads.store
FillFileStore
::
Build
.
queue_background_migration
FillFileStore
::
JobArtifact
.
queue_background_migration
FillFileStore
::
JobArtifact
.
queue_background_migration
FillFileStore
::
LfsObject
.
queue_background_migration
FillFileStore
::
LfsObject
.
queue_background_migration
FillFileStore
::
Upload
.
queue_background_migration
FillFileStore
::
Upload
.
queue_background_migration
...
...
lib/gitlab/background_migration/fill_file_store_build_archive.rb
deleted
100644 → 0
View file @
76f0d7fe
# frozen_string_literal: true
# rubocop:disable Metrics/AbcSize
# rubocop:disable Style/Documentation
module
Gitlab
module
BackgroundMigration
class
FillFileStoreBuildArchive
class
Build
<
ActiveRecord
::
Base
self
.
table_name
=
'ci_builds'
self
.
inheritance_column
=
:_type_disabled
end
def
perform
(
start_id
,
stop_id
)
FillFileStoreBuildArchive
::
Build
.
where
(
'artifacts_file_store = NULL'
)
.
where
(
id:
(
start_id
..
stop_id
))
.
update_all
(
artifacts_file_store:
1
)
end
end
end
end
lib/gitlab/background_migration/fill_file_store_build_metadata.rb
deleted
100644 → 0
View file @
76f0d7fe
# frozen_string_literal: true
# rubocop:disable Metrics/AbcSize
# rubocop:disable Style/Documentation
module
Gitlab
module
BackgroundMigration
class
FillFileStoreBuildMetadata
class
Build
<
ActiveRecord
::
Base
self
.
table_name
=
'ci_builds'
self
.
inheritance_column
=
:_type_disabled
end
def
perform
(
start_id
,
stop_id
)
FillFileStoreBuildMetadata
::
Build
.
where
(
'artifacts_metadata_store = NULL'
)
.
where
(
id:
(
start_id
..
stop_id
))
.
update_all
(
artifacts_metadata_store:
1
)
end
end
end
end
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