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

mock API: Move floating IP checks earlier in instance create handler #2466

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Sep 23, 2024

Noticed while working on #2464.

As the comment says: because we don't bother with being "smart" or "correct" in the mock API, we don't have sagas or transactions that let us undo DB writes when we run into an error in a complex handler like instance create. Instead, we have to make sure we do as much validation as we can up front so we can be Moderately Confident the DB writing portion of the operation is going to work if we manage to get that far. The floating IPs code combined validation and DB writes, which meant we could attach one IP and then blow up on the next one, leaving the first IP attached even though instance create overall failed. This change moves the validation earlier so we can blow up before any DB writes have happened.

Copy link

vercel bot commented Sep 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Oct 3, 2024 4:03pm

Base automatically changed from boot-order to main October 3, 2024 15:41
@david-crespo david-crespo force-pushed the move-floating-ips-checks branch from de0315f to 6fdcace Compare October 3, 2024 16:01
@david-crespo david-crespo marked this pull request as ready for review October 3, 2024 16:01
@david-crespo david-crespo force-pushed the move-floating-ips-checks branch from 6fdcace to 4794428 Compare October 3, 2024 16:02
@david-crespo david-crespo enabled auto-merge (squash) October 3, 2024 16:03
@david-crespo david-crespo merged commit 614f1bb into main Oct 3, 2024
8 checks passed
@david-crespo david-crespo deleted the move-floating-ips-checks branch October 3, 2024 16:15
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Oct 3, 2024
oxidecomputer/console@5561f28...073471c

* [073471c4](oxidecomputer/console@073471c4) mock api: disks are created straight into detached state
* [612ec90c](oxidecomputer/console@612ec90c) oxidecomputer/console#2485
* [614f1bb5](oxidecomputer/console@614f1bb5) oxidecomputer/console#2466
* [df2dc14c](oxidecomputer/console@df2dc14c) bump vite related deps for a weird vuln
* [a030b9e0](oxidecomputer/console@a030b9e0) oxidecomputer/console#2464
* [dec48497](oxidecomputer/console@dec48497) oxidecomputer/console#2461
* [e46216aa](oxidecomputer/console@e46216aa) oxidecomputer/console#2482
* [0d897efe](oxidecomputer/console@0d897efe) oxidecomputer/console#2479
* [f88790db](oxidecomputer/console@f88790db) oxidecomputer/console#2478
* [d634c8f0](oxidecomputer/console@d634c8f0) oxidecomputer/console#2477
* [eeaa14c3](oxidecomputer/console@eeaa14c3) oxidecomputer/console#2475
* [5ece6e18](oxidecomputer/console@5ece6e18) oxidecomputer/console#2467
* [4b699e01](oxidecomputer/console@4b699e01) oxidecomputer/console#2448
* [9c9dc149](oxidecomputer/console@9c9dc149) oxidecomputer/console#2465
* [1aa0fc9b](oxidecomputer/console@1aa0fc9b) oxidecomputer/console#2463
* [57db4054](oxidecomputer/console@57db4054) oxidecomputer/console#2462
* [da7fe328](oxidecomputer/console@da7fe328) oxidecomputer/console#2460
* [e0d52efd](oxidecomputer/console@e0d52efd) oxidecomputer/console#2437
* [1625d02a](oxidecomputer/console@1625d02a) oxidecomputer/console#2458
* [fd82458e](oxidecomputer/console@fd82458e) oxidecomputer/console#2457
* [7daaa337](oxidecomputer/console@7daaa337) oxidecomputer/console#2453
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Oct 3, 2024
oxidecomputer/console@5561f28...073471c

* [073471c4](oxidecomputer/console@073471c4)
mock api: disks are created straight into detached state
* [612ec90c](oxidecomputer/console@612ec90c)
oxidecomputer/console#2485
* [614f1bb5](oxidecomputer/console@614f1bb5)
oxidecomputer/console#2466
* [df2dc14c](oxidecomputer/console@df2dc14c)
bump vite related deps for a weird vuln
* [a030b9e0](oxidecomputer/console@a030b9e0)
oxidecomputer/console#2464
* [dec48497](oxidecomputer/console@dec48497)
oxidecomputer/console#2461
* [e46216aa](oxidecomputer/console@e46216aa)
oxidecomputer/console#2482
* [0d897efe](oxidecomputer/console@0d897efe)
oxidecomputer/console#2479
* [f88790db](oxidecomputer/console@f88790db)
oxidecomputer/console#2478
* [d634c8f0](oxidecomputer/console@d634c8f0)
oxidecomputer/console#2477
* [eeaa14c3](oxidecomputer/console@eeaa14c3)
oxidecomputer/console#2475
* [5ece6e18](oxidecomputer/console@5ece6e18)
oxidecomputer/console#2467
* [4b699e01](oxidecomputer/console@4b699e01)
oxidecomputer/console#2448
* [9c9dc149](oxidecomputer/console@9c9dc149)
oxidecomputer/console#2465
* [1aa0fc9b](oxidecomputer/console@1aa0fc9b)
oxidecomputer/console#2463
* [57db4054](oxidecomputer/console@57db4054)
oxidecomputer/console#2462
* [da7fe328](oxidecomputer/console@da7fe328)
oxidecomputer/console#2460
* [e0d52efd](oxidecomputer/console@e0d52efd)
oxidecomputer/console#2437
* [1625d02a](oxidecomputer/console@1625d02a)
oxidecomputer/console#2458
* [fd82458e](oxidecomputer/console@fd82458e)
oxidecomputer/console#2457
* [7daaa337](oxidecomputer/console@7daaa337)
oxidecomputer/console#2453
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.

1 participant