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)
Wed, Dec 18, 7:15 AM
Unknown Object (File)
Wed, Dec 18, 7:15 AM
Unknown Object (File)
Wed, Dec 18, 7:14 AM
Unknown Object (File)
Thu, Dec 12, 7:24 AM
Unknown Object (File)
Mon, Dec 9, 11:40 PM
Unknown Object (File)
Fri, Dec 6, 1:08 PM
Unknown Object (File)
Nov 25 2024, 6:59 PM
Unknown Object (File)
Nov 22 2024, 2:14 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.