Skip to content

Remove HipChat service and records

Arturo Herrero requested to merge 27954-remove-hipchat-service into master

What does this MR do?

Hipchat was discontinued by Atlassian in 2018, and support reached end-of-life in June of 2020.

We originally planned to remove it in %14.0, but due to the issue with mimemagic dependency #325851 (closed) we had to make it non-operational in %13.11. The gem and some code have been removed in !57434 (merged) and !57556 (merged).

This continue removing more code and deletes all the HipChat service records from the database.

Migration

$ rails db:migrate
== 20210420103955 RemoveHipchatServiceRecords: migrating ======================
== 20210420103955 RemoveHipchatServiceRecords: migrated (0.0539s) =============
$ rails db:migrate:down VERSION=20210420103955
== 20210420103955 RemoveHipchatServiceRecords: reverting ======================
== 20210420103955 RemoveHipchatServiceRecords: reverted (0.0000s) =============

Query

I've tried to delete the records without batching but the query was above the prescribed 1 second execution time:

DELETE FROM "services"
WHERE "services"."type" = 'HipchatService'
Time: 3.462 s
  - planning: 1.195 ms
  - execution: 3.461 s (estimated* for prod: 0.617...3.204 s)

https://console.postgres.ai/shared/13f409ef-d357-4231-87b0-3d3c52e0d586

It looks like we have 2755 records to be deleted from the database.

So, I'm running the deletion in batches of 100_000, see:

DELETE FROM "services"
WHERE "services"."type" = 'HipchatService'
  AND "services"."id" BETWEEN 1 AND 100000
Time: 15.142 ms
  - planning: 1.561 ms
  - execution: 13.581 ms
    - I/O read: 8.645 ms
    - I/O write: N/A

Shared buffers:
  - hits: 3 (~24.00 KiB) from the buffer pool
  - reads: 116 (~928.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

https://console.postgres.ai/shared/6205a566-adeb-4405-9a5e-b0a7a3592ee7

Related to #27954 (closed)

Edited by Arturo Herrero

Merge request reports