-
Notifications
You must be signed in to change notification settings - Fork 43
[nexus] Consider renaming some DB objects, for clarity #1192
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
Comments
Definitely on board with |
I'll create a separate branch for Instance -> VmInstance. |
I'm working on the Instance -> VmInstance change. Changing the instance was pretty painless. The trouble comes in when updating a NetworkInterface and a specific query. I keep running into issues HERE. Here's the full stack backtrace I continue receiving. I suspect that it's an issue with the DB, but I'm not sure how to check it. ryan@Ryans-MacBook-Air omicron % cargo test --package omicron-nexus --lib -- db::queries::network_interface::tests::test_insert_network_interface_query --exact --nocapture running 1 test as core::future::future::Future>::poll::hc43bf4659dcef3a9 failures: failures: test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 117 filtered out; finished in 3.77s error: test failed, to rerun pass '-p omicron-nexus --lib' |
@ryaeng That test asserts that there's a specific error condition reported. Look at the error condition that actually is returned, which should help you proceed. |
@bnaecker I came to the conclusion yesterday that I was most frustrated with the tool that I was using (Visual Studio Code). Debugging wasn't giving me anything helpful when looking for an error that was returned. While pondering this, I began to think there may be an issue with the tool I was using. I began searching for other solutions and came across CLion which one user praised as being easier to use when debugging Rust. I figured I had nothing to lose by giving it a try. First, when building the project CLion immediately threw up errors that I wasn't receiving when building in VS Code. This shouldn't have anything to do with VS Code as they'd both perform the build with Cargo. I fixed those issues first and then got to the point where the test was failing once again. Debugging in CLion immediately gave me a useful error code. There was a conflict with "network_interface_vm_instance_id_name_key". Searching for that string didn't return any results. However, searching for "network_interface_instance_id_name_key" did. I replaced that string with the aforementioned string and voila, test completed. I currently face a conflict of emotions. On one hand, I'm elated that the test is now passing. On the other, I'm pissed that the tool I was using hindered me from resolving this problem two days ago. Needless to say my taste for VS Code has slightly soured. |
Which IDE do you fellas use? |
I don't have a deeply informed opinion on the internal type renames but I feel strongly that we shouldn't rename |
To that I add: if you buy that premise, then having the internal name be something other than "Instance" seems likely to create more confusion than it eliminates. |
This sounds reasonable. What about renaming Service to ServiceInstance? Should we proceed with this change? |
For the latter, I would argue for something like “VirtualMachine”, but not sure how others feel about the verbosity.
… On 10 Jun 2022, at 11:50, Sean Klein ***@***.***> wrote:
As discussed with @davepacheco offline, there are a couple renames that might improve clarity within the codebase.
Note: These don't necessarily need to correlate with API changes, but given the combination of internal / external state nexus is handling, it might be worthwhile for readability.
Service -> ServiceInstance: Within the DB schema, "Service" currently refers to a single Zone, executing somewhere. However, under some circumstances, "Serivce" can refer to a collection of "Service Instances", where each is interchangeable, but provides redundancy. For example, each of the CRDB frontends acts like an "instance" for a "service". (RFD 248 has more detail).
By naming these "ServiceInstances", the ambiguity is lessened.
Instance -> VmInstance: Similarly, the thing called "Instance" in Nexus currently refers to an "Instance of a VM". Given that the word "instance" is useful in other contexts, disambiguating here may be useful too.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
As discussed with @davepacheco offline, there are a couple renames that might improve clarity within the codebase.
Note: These don't necessarily need to correlate with API changes, but given the combination of internal / external state nexus is handling, it might be worthwhile for readability.
Service -> ServiceInstance: Within the DB schema, "Service" currently refers to a single Zone, executing somewhere. However, under some circumstances, "Serivce" can refer to a collection of "Service Instances", where each is interchangeable, but provides redundancy. For example, each of the CRDB frontends acts like an "instance" for a "service". (RFD 248 has more detail).
By naming these "ServiceInstances", the ambiguity is lessened.
Instance -> VmInstance: Similarly, the thing called "Instance" in Nexus currently refers to an "Instance of a VM". Given that the word "instance" is useful in other contexts, disambiguating here may be useful too.
The text was updated successfully, but these errors were encountered: