Page MenuHomePhabricator

[keyserver] Fix account deletion performance
ClosedPublic

Authored by ashoat on Mar 24 2023, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 11:31 AM
Unknown Object (File)
Wed, Apr 17, 11:31 AM
Unknown Object (File)
Wed, Apr 17, 11:31 AM
Unknown Object (File)
Wed, Apr 17, 11:31 AM
Unknown Object (File)
Wed, Apr 17, 11:31 AM
Unknown Object (File)
Wed, Apr 17, 11:27 AM
Unknown Object (File)
Tue, Apr 16, 12:20 PM
Unknown Object (File)
Mar 14 2024, 1:36 AM
Subscribers
None

Details

Summary

Account deletion used to time out. After this it's basically instantaneous. The reports table is pretty huge...

More context here on Linear.

Test Plan

I ran it on prod and it fixed the issue

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I analyzed the queries we run on the reports table and found that creating a report runs this query, so I refined this index so it can help there as well. No other queries on reports seemed to do a full scan

Forgot to update createTables in the last revision

ashoat added inline comments.
keyserver/src/cron/cron.js
30 ↗(On Diff #24106)

Not sure why I missed this one in D6334. The context is explained there

keyserver/src/database/migration-config.js
224 ↗(On Diff #24106)

I already created this index on prod to test the fix, before I realized it would be better to have a more specific index. This part of the query should only affect prod

tomek added inline comments.
keyserver/src/cron/cron.js
30 ↗(On Diff #24106)

This is specific to a location of a keyserver, so we can also consider saying that it's in a keyserver's timezone instead of specifying a timezone explicitly.

This revision is now accepted and ready to land.Mar 27 2023, 2:10 AM

Clarify that it's in the timezone of the keyserver

This revision was landed with ongoing or failed builds.Mar 27 2023, 7:06 AM
This revision was automatically updated to reflect the committed changes.