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

allocate external IPs previously used by expunged zones #6483

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Aug 29, 2024

Closes #6260.

When applying the change suggested in that issue, some tests fail because the IPs in the planning input are no longer considered "seen". This might be due to tests not cleaning up the planning input between changes, but having looked through the reconfigurator preparation code it seems like the planning input from the database contains all external IP addresses ever assigned to services.

The test I've written successfully fails when the change to BuilderExternalNetworking::new is backed out.

@iliana iliana requested a review from jgallagher August 29, 2024 19:24
Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

Thanks for the more detailed investigation and fix!

having looked through the reconfigurator preparation code it seems like the planning input from the database contains all external IP addresses ever assigned to services.

This is a little surprising to me, but I think in the production path this should work as expected. Planning input is constructed via inspecting the database, and the blueprint executor deletes external IP records for expunged zones. I would not be surprised if many tests don't bother to do the DB cleanup we do in reality.

@iliana
Copy link
Contributor Author

iliana commented Aug 29, 2024

Ah, I didn't notice that we were deleting external IP records. But yes, this should work in production regardless.

The number of tests that were impacted by doing it the "right" way were pretty small, so I might look into fixing them instead of this approach.

Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

Nice, that is much less painful than I expected!

@iliana iliana merged commit 8dad6f0 into main Aug 30, 2024
22 checks passed
@iliana iliana deleted the iliana/6260 branch August 30, 2024 16:51
hawkw pushed a commit that referenced this pull request Aug 31, 2024
Closes #6260.

The test I've written successfully fails when the change to
`BuilderExternalNetworking::new` is backed out.
jgallagher added a commit that referenced this pull request Sep 18, 2024
The "Check the planning input" block of code needs to consider _all_
zones in the parent blueprint, including expunged zones. #6483 fixed the
planner's ability to reuse external IPs from expunged zones, but
accidentally made these checks incorrect, because it's certainly valid
for the planning input to still have records for expunged zones. See
#6581 (comment)
for more context.

We also get to remove the somewhat-awkward
update_network_resources_from_blueprint() test helper that was needed in #6483
to make some tests pass (because we didn't realize the checks being
performed here were wrong).
jgallagher added a commit that referenced this pull request Sep 18, 2024
The "Check the planning input" block of code needs to consider _all_
zones in the parent blueprint, including expunged zones. #6483 fixed the
planner's ability to reuse external IPs from expunged zones, but
accidentally made these checks incorrect, because it's certainly valid
for the planning input to still have records for expunged zones. See
#6581 (comment)
for more context.

We also get to remove the somewhat-awkward
update_network_resources_from_blueprint() test helper that was needed in #6483
to make some tests pass (because we didn't realize the checks being
performed here were wrong).
jgallagher added a commit that referenced this pull request Sep 18, 2024
…ng (#6599)

The "Check the planning input" block of code needs to consider _all_
zones in the parent blueprint, including expunged zones. #6483 fixed the
planner's ability to reuse external IPs from expunged zones, but
accidentally made these checks incorrect, because it's certainly valid
for the planning input to still have records for expunged zones. See
#6581 (comment)
for more context.

We also get to remove the somewhat-awkward
`update_network_resources_from_blueprint()` test helper that was needed
to make some tests pass (because we didn't realize the checks being
performed here were wrong).
jgallagher added a commit that referenced this pull request Oct 2, 2024
…rds (#6742)

Recapping from the update sync:

* #6483 moved the code restored by this PR into a helper method
(`update_network_resources_from_blueprint()`), and also added calls to
that method to a handful of tests to make them pass
* In the external DNS work, we discovered that those tests should not
have needed that, and the reason they did was because of a different bug
* #6599 fixed that bug and removed
`update_network_resources_from_blueprint()` and all its callers, but
neglected to restore this code, meaning the `PlanningInput`s our tests
create from their initial system descriptions never had any external
networking records
hawkw pushed a commit that referenced this pull request Oct 2, 2024
…rds (#6742)

Recapping from the update sync:

* #6483 moved the code restored by this PR into a helper method
(`update_network_resources_from_blueprint()`), and also added calls to
that method to a handful of tests to make them pass
* In the external DNS work, we discovered that those tests should not
have needed that, and the reason they did was because of a different bug
* #6599 fixed that bug and removed
`update_network_resources_from_blueprint()` and all its callers, but
neglected to restore this code, meaning the `PlanningInput`s our tests
create from their initial system descriptions never had any external
networking records
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.

Reconfigurator: Planner considers external IPs assigned to expunged zones to still be in use
2 participants