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

[nexus] improve abandoned_vmm_reaper OMDB status #6541

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Sep 7, 2024

While I was working on #6503, I became quite taken with the way @jmpesp
had done the OMDB status for his region-replacement background tasks ---
the approach of defining a struct in nexus-types representing the
status JSON that both the background task implementation and OMDB could
depend on seems much nicer than constructing an untyped JSON message and
then deserializing it to a type that only exists in OMDB, because this
way, OMDB and the background task implementation are kept in sync
automatically. So, I thought it would be nice to also rework the
abandoned_vmm_reaper task to use this style.

This commit does that. While I was making this change, I also changed
the status JSON to include a list of all errors that occurred during the
task's activation, instead of just the last one, which will probably
make it easier to debug any issues that come up. I also added some code
for aligning the numeric columns in the OMDB output.

I also changed the pagination of the database query to just use
the existing SQL_BATCH_SIZE constant.

@hawkw hawkw requested review from jmpesp and smklein September 7, 2024 16:39
While I was working on #6503, I became quite taken with the way @jmpesp
had done the OMDB status for his region-replacement background tasks ---
the approach of defining a struct in `nexus-types` representing the
status JSON that both the background task implementation and OMDB could
depend on seems much nicer than constructing an untyped JSON message and
then deserializing it to a type that only exists in OMDB, because this
way, OMDB and the background task implementation are kept in sync
automatically. So, I thought it would be nice to also rework the
`abandoned_vmm_reaper` task to use this style.

This commit does that. While I was making this change, I also changed
the status JSON to include a list of all errors that occurred during the
task's activation, instead of just the last one, which will probably
make it easier to debug any issues that come up. I also added some code
for aligning the numeric columns in the OMDB output.
hawkw added a commit that referenced this pull request Sep 7, 2024
Depends on #6541.

Similarly to #6541, this commit refactors the `instance_updater`
background task's OMDB status implementation to use a shared Rust struct
in `nexus-types` to represent the status JSON object. I also changed the
status message to include a full list of errors that occurred, instead
of just the most recent one and a count, and I made some tweaks to the
output alignment in OMDB.
@hawkw
Copy link
Member Author

hawkw commented Sep 8, 2024

Huh, this is weird, it looks like something was unexpectedly cancelled whilst running the "OMDB success cases" test: https://buildomat.eng.oxide.computer/wg/0/details/01J76SDJMRSAKXDSCDB937HA7W/HHiBDL096VXGcptoEmeZYVs0fOREFldEtGAm1fVPnfzCKYF8/01J76SDWEK961ZM8FDZSAAQK5T#S5356

That feels sketchy, because...I did change the OMDB output, but that test failure doesn't look related. Gonna rerun it and see what happens...

@hawkw hawkw merged commit a3917ea into main Sep 9, 2024
16 checks passed
@hawkw hawkw deleted the eliza/omdb-nice branch September 9, 2024 17:12
hawkw added a commit that referenced this pull request Sep 11, 2024
Depends on #6541.

Similarly to #6541, this commit refactors the `instance_updater`
background task's OMDB status implementation to use a shared Rust struct
in `nexus-types` to represent the status JSON object. I also changed the
status message to include a full list of errors that occurred, instead
of just the most recent one and a count, and I made some tweaks to the
output alignment in OMDB.
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