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
fc916b06
Commit
fc916b06
authored
May 27, 2018
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate jobs in object_storage_upload queue
parent
53811074
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
1 deletion
+55
-1
changelogs/unreleased/jprovazn-uploader-migration.yml
changelogs/unreleased/jprovazn-uploader-migration.yml
+5
-0
db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb
...0603190921_migrate_object_storage_upload_sidekiq_queue.rb
+16
-0
db/schema.rb
db/schema.rb
+1
-1
spec/migrations/migrate_object_storage_upload_sidekiq_queue_spec.rb
...tions/migrate_object_storage_upload_sidekiq_queue_spec.rb
+33
-0
No files found.
changelogs/unreleased/jprovazn-uploader-migration.yml
0 → 100644
View file @
fc916b06
---
title
:
Migrate any remaining jobs from deprecated `object_storage_upload` queue.
merge_request
:
author
:
type
:
deprecated
db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb
0 → 100644
View file @
fc916b06
class
MigrateObjectStorageUploadSidekiqQueue
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
sidekiq_queue_migrate
'object_storage_upload'
,
to:
'object_storage:object_storage_background_move'
end
def
down
# do not migrate any jobs back because we would migrate also
# jobs which were not part of the 'object_storage_upload'
end
end
db/schema.rb
View file @
fc916b06
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180
531220618
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180
603190921
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
spec/migrations/migrate_object_storage_upload_sidekiq_queue_spec.rb
0 → 100644
View file @
fc916b06
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20180603190921_migrate_object_storage_upload_sidekiq_queue.rb'
)
describe
MigrateObjectStorageUploadSidekiqQueue
,
:sidekiq
,
:redis
do
include
Gitlab
::
Database
::
MigrationHelpers
context
'when there are jobs in the queue'
do
it
'correctly migrates queue when migrating up'
do
Sidekiq
::
Testing
.
disable!
do
stubbed_worker
(
queue:
'object_storage_upload'
).
perform_async
(
'Something'
,
[
1
])
stubbed_worker
(
queue:
'object_storage:object_storage_background_move'
).
perform_async
(
'Something'
,
[
1
])
described_class
.
new
.
up
expect
(
sidekiq_queue_length
(
'object_storage_upload'
)).
to
eq
0
expect
(
sidekiq_queue_length
(
'object_storage:object_storage_background_move'
)).
to
eq
2
end
end
end
context
'when there are no jobs in the queues'
do
it
'does not raise error when migrating up'
do
expect
{
described_class
.
new
.
up
}.
not_to
raise_error
end
end
def
stubbed_worker
(
queue
:)
Class
.
new
do
include
Sidekiq
::
Worker
sidekiq_options
queue:
queue
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