Backfill clusters_integration_prometheus.enabled
What does this MR do?
Next step of #327655 (closed), building on !60877 (merged). Once this has been rolled out, we can start relying on the integration record as the source of truth for whether the in-cluster prometheus is available.
Migration output
$ RAILS_ENV=test bin/rails db:migrate
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: migrating =====
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: migrated (0.0017s)
$ RAILS_ENV=test bin/rails db:rollback
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: reverting =====
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: reverted (0.0000s)
#database-lab
output
https://gitlab.slack.com/archives/CLJMDRD8C/p1621467221098100 (internal link)
Summary
Time: 866.382 ms
- planning: 1.024 ms
- execution: 865.358 ms
- I/O read: 19.630 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 57148 (~446.50 MiB) from the buffer pool
- reads: 211 (~1.60 MiB) from the OS file cache, including disk I/O
- dirtied: 140 (~1.10 MiB)
- writes: 107 (~856.00 KiB)
Plan with execution
ModifyTable on public.clusters_integration_prometheus (cost=0.08..1032.10 rows=9337 width=89) (actual time=87.112..87.115 rows=0 loops=1)
Buffers: shared hit=57148 read=211 dirtied=140 written=107
I/O Timings: read=19.630 write=0.000
CTE executed_at
-> Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.029..0.030 rows=1 loops=1)
I/O Timings: read=0.000 write=0.000
InitPlan 2 (returns $1)
-> CTE Scan on executed_at (cost=0.00..0.02 rows=1 width=8) (actual time=0.032..0.033 rows=1 loops=1)
I/O Timings: read=0.000 write=0.000
InitPlan 3 (returns $2)
-> CTE Scan on executed_at executed_at_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)
I/O Timings: read=0.000 write=0.000
InitPlan 4 (returns $3)
-> CTE Scan on executed_at executed_at_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1)
I/O Timings: read=0.000 write=0.000
-> Seq Scan on public.clusters_applications_prometheus (cost=0.00..1032.03 rows=9337 width=89) (actual time=1.422..19.939 rows=9340 loops=1)
Filter: (clusters_applications_prometheus.status = ANY ('{3,11}'::integer[]))
Rows Removed by Filter: 5222
Buffers: shared read=195 dirtied=21
I/O Timings: read=9.783 write=0.000
Does this MR meet the acceptance criteria?
Conformity
-
I have included a changelog entry, or it's not needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Hordur Freyr Yngvason