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
1487cf22
Commit
1487cf22
authored
Feb 22, 2022
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule async weekend build of index for job traces
Changelog: performance
parent
6172b14a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb
...grate/20220224000000_async_build_trace_expire_at_index.rb
+14
-0
db/schema_migrations/20220224000000
db/schema_migrations/20220224000000
+1
-0
ee/spec/migrations/async_build_trace_expire_at_index_spec.rb
ee/spec/migrations/async_build_trace_expire_at_index_spec.rb
+26
-0
No files found.
db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb
0 → 100644
View file @
1487cf22
# frozen_string_literal: true
class
AsyncBuildTraceExpireAtIndex
<
Gitlab
::
Database
::
Migration
[
1.0
]
INDEX_NAME
=
'tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at'
TIMESTAMPS
=
"'2021-04-22 00:00:00', '2021-05-22 00:00:00', '2021-06-22 00:00:00', '2022-01-22 00:00:00', '2022-02-22 00:00:00', '2022-03-22 00:00:00', '2022-04-22 00:00:00'"
def
up
prepare_async_index
:ci_job_artifacts
,
:id
,
where:
"file_type = 3 AND expire_at IN (
#{
TIMESTAMPS
}
)"
,
name:
INDEX_NAME
end
def
down
unprepare_async_index
:ci_builds
,
:id
,
name:
INDEX_NAME
end
end
db/schema_migrations/20220224000000
0 → 100644
View file @
1487cf22
74b4d572118b7f5da0a80722601a4757ce47ccbdae1af1e84b2304343477d634
\ No newline at end of file
ee/spec/migrations/async_build_trace_expire_at_index_spec.rb
0 → 100644
View file @
1487cf22
# frozen_string_literal: true
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20220224000000_async_build_trace_expire_at_index.rb'
)
RSpec
.
describe
AsyncBuildTraceExpireAtIndex
do
describe
'#up'
do
it
'sets up a delayed concurrent index creation'
do
expect_next_instance_of
(
described_class
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:prepare_async_index
)
end
migrate!
end
end
describe
'#down'
do
it
'removes an index'
do
expect_any_instance_of
(
described_class
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:unprepare_async_index
)
end
schema_migrate_down!
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