Skip to content

WIP: Remove GitlabIssueTrackerService records

What does this MR do?

Related to #218526 (closed)

It stops services of type GitlabIssueTrackerService from being created and removes all records from the database.

It is not possible to add custom settings by editing the service in the UI or API so there is no need of having database records. In general, it looks like GitlabIssueTrackerService is not used anymore. I'm working towards removing the class and all code references as well.

Migration output

== 20200609075351 RemoveGitlabIssueTrackerServiceRecords: migrating ===========
-- execute("DELETE FROM services WHERE type = 'GitlabIssueTrackerService';")
   -> 0.0011s
== 20200609075351 RemoveGitlabIssueTrackerServiceRecords: migrated (0.0012s) ==

I run this in databse-lab. If I'm reading this right, there are 2931500 records to be deleted

explain DELETE FROM services WHERE type = 'GitlabIssueTrackerService';

Session: joe-brfqrto350j65v2mjer0

Plan with execution:

 ModifyTable on public.services  (cost=0.56..457662.43 rows=2931500 width=6) (actual time=130375.128..130375.128 rows=0 loops=1)
   Buffers: shared hit=8263518 read=123171 dirtied=101537
   I/O Timings: read=118138.276
   ->  Index Scan using index_services_on_project_id_and_type on public.services  (cost=0.56..457662.43 rows=2931500 width=6) (actual time=10.907..124196.585 rows=2933937 loops=1)
         Index Cond: ((services.type)::text = 'GitlabIssueTrackerService'::text)
         Buffers: shared hit=2297147 read=123164 dirtied=2181
         I/O Timings: read=118131.748

Recommendations: Query processes too much data to return a relatively small number of rows. – Reduce data cardinality as early as possible during the execution, using one or several of the following techniques: new indexes, partitioning, query rewriting, denormalization. See the visualization of the plan to understand which plan nodes are the main bottlenecks. Show details

Summary:

Time: 5.866 min
  - planning: 0.142 ms
  - execution: 5.866 min
    - I/O read: 1.969 min
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 8263518 (~63.00 GiB) from the buffer pool
  - reads: 123171 (~962.30 MiB) from the OS file cache, including disk I/O
  - dirtied: 101537 (~793.30 MiB)
  - writes: 0

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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 🤖 GitLab Bot 🤖

Merge request reports

Loading