Skip to content

Conversation

@nicu-da
Copy link
Contributor

@nicu-da nicu-da commented Jan 22, 2026

[static]

3 step migration process:

  1. Deploy with hyperdisk support enabled and migrating true. This takes a snapshot of the old pvc configures postgres to recreate it with new values for the pvc template that specifies the dataSource as the created snapshot, thus bootstrapping from the old data
  2. Deploy with hyperdisk support enabled, migrating false and recreate postgres releases set to true. This removes the snapshot and the pvc template dataSource so that in the future if you delete the pvc it doesn't recreate it from the snapshot
  3. Deloy with hyperdisk support enabled only

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

[static]

Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
@isegall-da
Copy link
Contributor

Haven't looked at the code yet (will do a bit later when I'm back at the pc), but from your description it sounds like "migrating" has three value: true, false, and undefined? That sounds quite confusing, wouldn't it be better to give it three explicit values rather than using "undefined" as the third? Or at least not use boolean for the other two.

@nicu-da
Copy link
Contributor Author

nicu-da commented Jan 22, 2026

Haven't looked at the code yet (will do a bit later when I'm back at the pc), but from your description it sounds like "migrating" has three value: true, false, and undefined? That sounds quite confusing, wouldn't it be better to give it three explicit values rather than using "undefined" as the third? Or at least not use boolean for the other two.

No, it just defaults to false. Same for all the other flags, all default to false.

volumeMode: Filesystem
{{- with .Values.db.dataSource }}
dataSource:
{{- toYaml . | nindent 8 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are a brave man... I would have done a helm test here just to be sure I counted the whitespaces right (I think I'd still soft recommend it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a full manual test to migrate a scratch

const smallDiskSize = clusterSmallDisk ? '240Gi' : undefined;
const supportsHyperdisk =
hyperdiskSupportConfig.hyperdiskSupport.enabled && !useInfraAffinityAndTolerations;
let hyperdiskMigrationValues = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not do const hyperdiskMigrationValues = xyz ? { ... } : { } like we usually do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have to create the snapshot in the if

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see; this sounds like a reason then...

want to add a brief comment? (nit)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the value of the comment tbh, it would comment on the syntax of typescript not add any extra details about the why

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why can't you write this in functional style again?

Would something like this work?

const hyperdiskMigrationValues = (xyz ? (() => { new xyz; return {abc}) : (() => {}))()

(all of this is nit; I just stumbled about the inconsistency so figured other readers might too; we very rarely use mutable variables)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do use mutable variables in tyepscript when needed.
I find that the mutable state with the if is much cleaner to read compared to an anonymous function that gets called in the same line. It took me a few reads to figure out the nested complexity there.

namespace: xns.logicalName,
},
spec: {
volumeSnapshotClassName: 'dev-vsc',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

offtopic, just ranting: that name...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have no idea who created that, it's in all the clusters 🤷 not managed by us

Copy link
Contributor

@martinflorian-da martinflorian-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks scary but also somehow reasonable...

I did a full manual test to migrate a scratch

Well if you say so 👍

Thanks!

[static]

Co-authored-by: Martin Florian <martin.florian@digitalasset.com>
Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
@nicu-da nicu-da merged commit 0711ca2 into main Jan 22, 2026
44 checks passed
@nicu-da nicu-da deleted the nicuda/techdebt/support_postgres_migration_hyperdisk branch January 22, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants