Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing #7

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Fix importing #7

merged 2 commits into from
Mar 25, 2024

Conversation

billyb2
Copy link
Contributor

@billyb2 billyb2 commented Mar 25, 2024

Instead of trying to connect to <appname>.internal and hoping that SkipDNSRegistration does the job, we can just guarantee that importing works by connecting to a known postgres machine (<machine_id>.vm.<appname>.internal)

Related to:
superfly/flyctl#3401

billyb2 added 2 commits March 25, 2024 10:24
Otherwise, it's more difficult to debug errors
We previously had a bug where, due to the fact that we weren't skipping
DNS registration, `fly pg import` would create a machine that tried to
import from itself, obviously failing. Although the DNS registration bug
is [being fixed](https://github.com/superfly/fly-proxy/pull/1192), I
still think that relying on skipping DNS registration is a little silly,
when we can just guarantee we'll connect to the correct machine using
6PN wizardry. `flyctl` needs to specify a machine ID to connect to
which, as of writing, is just any working machine in the app we want to
import into.
billyb2 added a commit to superfly/flyctl that referenced this pull request Mar 25, 2024
Relies on fly-apps/postgres-importer#7, but
basically, we just specify the machine ID of the machine to connect to
when importing, rather than relying on `<appname>.internal` not giving
us the ID of the ephemeral machine.
@billyb2 billyb2 mentioned this pull request Mar 25, 2024
3 tasks
@billyb2 billyb2 merged commit 53c0755 into main Mar 25, 2024
4 checks passed
@billyb2 billyb2 deleted the fix_import branch March 25, 2024 15:55
billyb2 added a commit to superfly/flyctl that referenced this pull request Mar 25, 2024
* Fix pg import

Relies on fly-apps/postgres-importer#7, but
basically, we just specify the machine ID of the machine to connect to
when importing, rather than relying on `<appname>.internal` not giving
us the ID of the ephemeral machine.

* Choose PG leader's machine ID

Also use AppCompact to save a round trip call to web

* Make sure to include the app name in the flaps client
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.

2 participants