Page MenuHomePhabricator

[keyserver/lib] Introduce a specialRoles enum and special_role column in MariaDB
ClosedPublic

Authored by rohan on Nov 23 2023, 8:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 4:54 AM
Unknown Object (File)
Sat, May 4, 3:23 AM
Unknown Object (File)
Tue, Apr 30, 12:00 AM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:03 PM
Unknown Object (File)
Apr 8 2024, 6:00 PM
Subscribers

Details

Summary

We introduce the specialRoles enum that maps a DEFAULT_ROLE to a specfic number we store in MariaDB. With this, we can run a migration that:

  1. Adds a special_role column to roles
  2. Update each row in roles to populate the special_role field if it is the defualt role

Addresses ENG-5831 and ENG-5832

Test Plan

Ran the migration and confirmed it succeeded. Also checked my roles table to make sure the correct roles were updated

Screenshot 2023-11-23 at 11.17.35 AM.png (1×1 px, 663 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan retitled this revision from [keyserver/lib] Introduce a specialRoles enum and special_role column in MariaDB" to [keyserver/lib] Introduce a specialRoles enum and special_role column in MariaDB.Nov 23 2023, 8:18 AM
rohan edited the test plan for this revision. (Show Details)
rohan requested review of this revision.Nov 23 2023, 8:43 AM
This revision is now accepted and ready to land.Nov 27 2023, 12:44 AM

Change index on roles from thread to thread_special_role. Re-requesting review since I'd like another pass on this.

Tested this by running SHOW INDEX FROM roles both before and after and confirmed the index was created.

Did some research prior to this and looks like MySQL doesn't support a ALTER INDEX statement, so dropping the index & recreating it seems like the best path forward.

rohan requested review of this revision.Nov 27 2023, 8:18 AM
This revision is now accepted and ready to land.Nov 27 2023, 8:25 AM
This revision was landed with ongoing or failed builds.Nov 27 2023, 10:36 AM
This revision was automatically updated to reflect the committed changes.