Skip to content

CA-405754: Update xapi-storage-script state.db #6274

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

Merged

Conversation

Vincent-lau
Copy link
Contributor

xapi-storage-script maintains a state.db which is loaded on startup every time. This state.db contains currently attached SRs, and this information can be used later on by xapi to decide whether to plug a PBD in.

This information is correctly updated when adding an attached SR in, but not when removing an SR. This will cause problems when an SR is detached, followed by a toolstack restart. As now xapi-storage-script still thinks that SR is attached, but in fact it is not.

@Vincent-lau Vincent-lau force-pushed the private/shul2/plugged-in branch from 1704127 to aad27b3 Compare February 4, 2025 16:03
@lindig
Copy link
Contributor

lindig commented Feb 5, 2025

Should we use let* more to avoid >>=?

@Vincent-lau Vincent-lau force-pushed the private/shul2/plugged-in branch from aad27b3 to 710accf Compare February 5, 2025 13:17
@Vincent-lau
Copy link
Contributor Author

Should we use let* more to avoid >>=?

Yeah there is >>= and let* and >>>= in xapi-storage-script. My personal preference would be to use >>= and >>>= so it's clear what monad we are trying to deal with. We could alternatively invent another let+ for example for Lwt_result.t and keep using let* and let+

xapi-storage-script maintains a state.db which is loaded on startup
every time. This state.db contains currently attached SRs, and this
information can be used later on by xapi to decide whether to plug a PBD
in.

This information is correctly updated when adding an attached SR in, but
not when removing an SR. This will cause problems when an SR is
detached, followed by a toolstack restart. As now xapi-storage-script
still thinks that SR is attached, but in fact it is not.

Signed-off-by: Vincent Liu <[email protected]>
@Vincent-lau Vincent-lau force-pushed the private/shul2/plugged-in branch from 710accf to 44145a6 Compare February 5, 2025 14:02
@psafont
Copy link
Member

psafont commented Feb 5, 2025

We could follow a similar convention to the monadic operators for the let ones: let*for Lwt.t and let** for Lwt_result.t

@Vincent-lau Vincent-lau added this pull request to the merge queue Feb 6, 2025
Merged via the queue into xapi-project:master with commit 51897aa Feb 6, 2025
15 checks passed
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.

4 participants