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

CP-49446: Update SR health to include new constructors #5659

Merged

Conversation

contificate
Copy link
Contributor

Currently, the storage layer tracks two extra SR health statuses that XAPI is unaware of. These are "unreachable" and "unavailable". At present, the storage side simply maps these to "recovering" when sending information to the toolstack. This change will allow XAPI to track more accurate SR health statuses.

See this excerpt from xapi-storage-plugins (util.py) which maps these new constructors to the extant "recovering" enum.

def sr_status_to_xapi(sr_status):
    """
    Convert the SR statuses we know internally into a String which XAPI understands.
    This small layer of indirection allows us to experiment with more states than XAPI
    knows of internally, until such time as XAPI is ready to learn of them.
    """
    if sr_status == SR_STATUS_OK:
        return "Healthy"
    if sr_status == SR_STATUS_RECOVERING:
        return "Recovering"
    if sr_status == SR_STATUS_UNREACHABLE:
        # XAPI does not yet understand "Unreachable"
        return "Recovering"
    if sr_status == SR_STATUS_UNAVAILABLE:
        # XAPI does not yet understand "Unavailable"
        return "Recovering"

Currently, the storage layer tracks two extra SR health statuses that XAPI is
unaware of. These are "unreachable" and "unavailable". At present, the storage
side simply maps these to "recovering" when sending information to the
toolstack. This change will allow the storage layer to track more accurate SR
health statuses.

Signed-off-by: Colin James <colin.barr@cloud.com>
Updates the formatting to fit what is expected by CI.

Signed-off-by: Colin James <colin.barr@cloud.com>
@psafont
Copy link
Member

psafont commented May 30, 2024

The failure happens because the external API changed.
The hash in the test binary needs to be changed, and the minor_vsn in ocaml/idl/datamodel_common.ml (line 13)

File "ocaml/idl/dune", line 52, characters 8-18:
52 |   (name schematest)
             ^^^^^^^^^^
(cd _build/default/ocaml/idl && ./schematest.exe)


New schema hash ('9cdffb92b17ec72818be9fb32a5f87b8') doesn't match the last known one. Please bump the
datamodel schema versions if necessary, and update 'last_known_schema_hash'.

Updates the last known hash to reflect recent changes to the data model.

Signed-off-by: Colin James <colin.barr@cloud.com>
@contificate contificate marked this pull request as ready for review May 31, 2024 09:39
Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

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

The commits should be squashed before merging

@@ -2791,6 +2791,8 @@ module Sr_stat = struct
, [
("healthy", "Storage is fully available")
; ("recovering", "Storage is busy recovering, e.g. rebuilding mirrors.")
; ("unreachable", "Storage is unreachable")
; ("unavailable", "Storage is unavailable")
Copy link
Member

Choose a reason for hiding this comment

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

Please update the ~lifecycle arg of the health field definition below, which this enum is used to indicate the change. E.g.:

~lifecycle:[(Prototyped, rel_kolkata, ""); (Published, rel_lima, ""); Extended, "24.16.0", "Enum extended with 'unreachable' and 'unavailable' values"]

Signed-off-by: Colin James <colin.barr@cloud.com>
Signed-off-by: Colin James <colin.barr@cloud.com>
@robhoes robhoes merged commit 5ec4c26 into xapi-project:master May 31, 2024
14 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.

3 participants