Page MenuHomePhabricator

[keyserver] add migration type to migrations
ClosedPublic

Authored by will on Aug 29 2024, 12:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 2:14 PM
Unknown Object (File)
Fri, Nov 22, 9:34 AM
Unknown Object (File)
Fri, Nov 22, 4:41 AM
Unknown Object (File)
Wed, Nov 20, 11:53 AM
Unknown Object (File)
Sat, Nov 9, 5:04 PM
Unknown Object (File)
Sat, Nov 9, 2:43 PM
Unknown Object (File)
Oct 22 2024, 6:29 PM
Unknown Object (File)
Oct 22 2024, 1:18 PM
Subscribers

Details

Summary

This introduces the MigrationType which we can use to specify whether we want to wrap a migration in a transaction and block secondary nodes.

Depends on D13208

Test Plan

Tested later in stack

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will requested review of this revision.Aug 29 2024, 1:47 PM
will retitled this revision from add migration type to migrations to [keyserver] add migration type to migrations.Aug 30 2024, 10:17 AM

if a dev is introducing a new migration how will they know which migrationType variant to use? can we instead introduce an optional field in Migration to override the default behavior?

if a dev is introducing a new migration how will they know which migrationType variant to use? can we instead introduce an optional field in Migration to override the default behavior?

We could make wrap_in_transaction_and_block_requests the default behavior.

Was wondering if you think this is better suited as a boolean. Originally had this is as string union but liked the explicative naming of these types, allowing us to possibly introduce new migrationTypes later as well (but unsure how likely this is).

In D13209#373102, @will wrote:

if a dev is introducing a new migration how will they know which migrationType variant to use? can we instead introduce an optional field in Migration to override the default behavior?

We could make wrap_in_transaction_and_block_requests the default behavior.

Was wondering if you think this is better suited as a boolean. Originally had this is as string union but liked the explicative naming of these types, allowing us to possibly introduce new migrationTypes later as well (but unsure how likely this is).

I think you can keep MigrationType as-is and just change Migration:

export type Migration = {
  +version: number,
  +migrationPromise: () => Promise<mixed>,
  +migrationType?: MigrationType,
};

then in the logic where you check the migrationType, just treat "wrap in transaction" as the default behavior if the field is missing

This revision is now accepted and ready to land.Sep 4 2024, 11:17 PM
This revision was automatically updated to reflect the committed changes.