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
84d15ca3
Commit
84d15ca3
authored
Apr 01, 2022
by
David Fernandez
Committed by
Jan Provaznik
Apr 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enqueuer job: add container repository migration state logging
parent
47a44824
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
app/workers/container_registry/migration/enqueuer_worker.rb
app/workers/container_registry/migration/enqueuer_worker.rb
+10
-0
spec/workers/container_registry/migration/enqueuer_worker_spec.rb
...kers/container_registry/migration/enqueuer_worker_spec.rb
+9
-4
No files found.
app/workers/container_registry/migration/enqueuer_worker.rb
View file @
84d15ca3
...
@@ -41,6 +41,8 @@ module ContainerRegistry
...
@@ -41,6 +41,8 @@ module ContainerRegistry
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
next_aborted_repository_id:
next_aborted_repository
&
.
id
)
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
next_aborted_repository_id:
next_aborted_repository
&
.
id
)
true
true
ensure
log_repository_migration_state
(
next_aborted_repository
)
end
end
def
handle_next_migration
def
handle_next_migration
...
@@ -59,6 +61,8 @@ module ContainerRegistry
...
@@ -59,6 +61,8 @@ module ContainerRegistry
next_repository
&
.
abort_import
next_repository
&
.
abort_import
false
false
ensure
log_repository_migration_state
(
next_repository
)
end
end
def
tag_count_too_high?
def
tag_count_too_high?
...
@@ -151,6 +155,12 @@ module ContainerRegistry
...
@@ -151,6 +155,12 @@ module ContainerRegistry
log_extra_metadata_on_done
(
:container_repository_path
,
repository
&
.
path
)
log_extra_metadata_on_done
(
:container_repository_path
,
repository
&
.
path
)
end
end
def
log_repository_migration_state
(
repository
)
return
unless
repository
log_extra_metadata_on_done
(
:container_repository_migration_state
,
repository
.
migration_state
)
end
# used by ExclusiveLeaseGuard
# used by ExclusiveLeaseGuard
def
lease_key
def
lease_key
'container_registry:migration:enqueuer_worker'
'container_registry:migration:enqueuer_worker'
...
...
spec/workers/container_registry/migration/enqueuer_worker_spec.rb
View file @
84d15ca3
...
@@ -64,7 +64,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
...
@@ -64,7 +64,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
expect_log_extra_metadata
(
expect_log_extra_metadata
(
import_type:
'next'
,
import_type:
'next'
,
container_repository_id:
container_repository
.
id
,
container_repository_id:
container_repository
.
id
,
container_repository_path:
container_repository
.
path
container_repository_path:
container_repository
.
path
,
container_repository_migration_state:
'pre_importing'
)
)
subject
subject
...
@@ -135,7 +136,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
...
@@ -135,7 +136,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
expect_log_extra_metadata
(
expect_log_extra_metadata
(
import_type:
'retry'
,
import_type:
'retry'
,
container_repository_id:
aborted_repository
.
id
,
container_repository_id:
aborted_repository
.
id
,
container_repository_path:
aborted_repository
.
path
container_repository_path:
aborted_repository
.
path
,
container_repository_migration_state:
'importing'
)
)
subject
subject
...
@@ -158,7 +160,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
...
@@ -158,7 +160,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
expect_log_extra_metadata
(
expect_log_extra_metadata
(
import_type:
'retry'
,
import_type:
'retry'
,
container_repository_id:
aborted_repository
.
id
,
container_repository_id:
aborted_repository
.
id
,
container_repository_path:
aborted_repository
.
path
container_repository_path:
aborted_repository
.
path
,
container_repository_migration_state:
'import_aborted'
)
)
subject
subject
...
@@ -189,6 +192,7 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
...
@@ -189,6 +192,7 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
import_type:
'next'
,
import_type:
'next'
,
container_repository_id:
container_repository
.
id
,
container_repository_id:
container_repository
.
id
,
container_repository_path:
container_repository
.
path
,
container_repository_path:
container_repository
.
path
,
container_repository_migration_state:
'import_skipped'
,
tags_count_too_high:
true
,
tags_count_too_high:
true
,
max_tags_count_setting:
2
max_tags_count_setting:
2
)
)
...
@@ -212,7 +216,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
...
@@ -212,7 +216,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
expect_log_extra_metadata
(
expect_log_extra_metadata
(
import_type:
'next'
,
import_type:
'next'
,
container_repository_id:
container_repository
.
id
,
container_repository_id:
container_repository
.
id
,
container_repository_path:
container_repository
.
path
container_repository_path:
container_repository
.
path
,
container_repository_migration_state:
'import_aborted'
)
)
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:log_exception
).
with
(
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:log_exception
).
with
(
...
...
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