Skip to content

Add handler in bmcctld for RACK_MANAGER_DATA_TABLE for rack manager telemetry - #880

Open
judyjoseph wants to merge 1 commit into
sonic-net:masterfrom
judyjoseph:bmcctld_include_rack_mgr_telemetry
Open

Add handler in bmcctld for RACK_MANAGER_DATA_TABLE for rack manager telemetry#880
judyjoseph wants to merge 1 commit into
sonic-net:masterfrom
judyjoseph:bmcctld_include_rack_mgr_telemetry

Conversation

@judyjoseph

@judyjoseph judyjoseph commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

bmcctld now subscribes to RACK_MANAGER_ALERT and gates Switch-Host power-on while any alert reads CRITICAL (has_critical_rack_mgr_alert). Because Rack Manager only writes deviations (CRITICAL/MAJOR/MINOR) to RACK_MANAGER_ALERT and never writes NORMAL, a raised alert never clears itself.

Per the pmon-bmc-design document, Rack Manager also publishes periodic telemetry to a separate STATE_DB table, RACK_MANAGER_DATA, whose purpose is to signal when a critical alert has cleared. This PR adds a handler that consumes that telemetry. When a sensor's telemetry severity returns to NORMAL, the corresponding RACK_MANAGER_ALERT entry is deleted so the power-on gate no longer treats it as active.
REF : https://github.com/sonic-net/SONiC/blob/master/doc/bmc/sonicBMC/pmon-bmc-design.md#2121-db-schema

Motivation and Context

-- Add RACK_MANAGER_DATA subscriber and integrate it into the select loop and file-descriptor-to-handler dispatch map.
-- Add _handle_rack_mgr_data(key, fvs):
-- Read severity from:
severity field for temperature, flow, and pressure telemetry.
leak field for Rack_level_leak.
-- Treat non-NORMAL telemetry as informational only; no action is taken.
Alerts continue to be raised via RACK_MANAGER_ALERT.
-- On NORMAL: Delete only the matching RACK_MANAGER_ALERT| entry (per-key scope).
Clear the cached last-severity value for that key.
Log a notice.
No-op if no active alert exists for that key.

Add RACK_MGR_TELEMETRY_KEYS module constant containing the four supported telemetry sensors:
Inlet_liquid_temperature
Inlet_liquid_flow_rate
Inlet_liquid_pressure
Rack_level_leak

How Has This Been Tested?

Following unit tests are added

   1. test_data_subscriber_registered - the rack-manager data subscriber is registered and routed to _handle_rack_mgr_data.               ┃
   2. test_normal_telemetry_clears_active_alert - NORMAL telemetry deletes the matching alert row and resets dedup state.                 ┃
   3. test_normal_telemetry_no_active_alert_is_noop - NORMAL telemetry with no active alert does nothing.                                 ┃
   4. test_non_normal_telemetry_leaves_alert - non-NORMAL telemetry never clears an alert.                                                ┃
   5. test_rack_level_leak_telemetry_clears_via_leak_field - Rack_level_leak reports NORMAL via the 'leak' field and clears the alert.    ┃
   6. test_mixed_case_normal_clears - a mixed-case "Normal" severity still clears the alert (case-insensitive).                           ┃
   7. test_unknown_telemetry_key_ignored - telemetry under a key outside ALERT_KEYS is ignored.       

Additional Information (Optional)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): msft-202608, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202608: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

@judyjoseph
judyjoseph marked this pull request as ready for review August 28, 2026 19:17
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@judyjoseph
judyjoseph requested a review from yxieca August 28, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants