Page MenuHomePhabricator

[keyserver] add migration type to migrations
ClosedPublic

Authored by will on Aug 29 2024, 12:18 PM.
Tags
None
Referenced Files
F3005647: D13209.id43813.diff
Fri, Oct 18, 5:15 PM
Unknown Object (File)
Tue, Oct 15, 10:55 PM
Unknown Object (File)
Sat, Oct 12, 7:37 AM
Unknown Object (File)
Sat, Oct 12, 2:14 AM
Unknown Object (File)
Sat, Oct 12, 12:28 AM
Unknown Object (File)
Thu, Oct 10, 11:59 PM
Unknown Object (File)
Thu, Oct 10, 10:14 PM
Unknown Object (File)
Thu, Oct 10, 9:59 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
Lint Not Applicable
Unit
Tests Not Applicable

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.