Skip to content

fix(platform-connectors): recover after GPU replacement - #1587

Open
iacker wants to merge 3 commits into
NVIDIA:mainfrom
iacker:fix/gpu-replacement-recovery-1585
Open

fix(platform-connectors): recover after GPU replacement#1587
iacker wants to merge 3 commits into
NVIDIA:mainfrom
iacker:fix/gpu-replacement-recovery-1585

Conversation

@iacker

@iacker iacker commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Fixes #1585.

GPU recovery now ignores GPU_UUID when a stable GPU index or PCI address is present. This lets a healthy event clear the old node condition after a physical GPU replacement, while preserving UUID-only and non-GPU matching behavior.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation
  • 🔧 Refactoring
  • 🔨 Build/CI

Component(s) Affected

  • Core Services
  • Documentation/CI
  • Fault Management
  • Health Monitors
  • Janitor
  • Other: ____________

Testing

  • Tests pass locally
  • Manual testing completed
  • No breaking changes (or documented)

Checklist

  • Self-review completed
  • Documentation updated (if needed)
  • Ready for review

Summary by CodeRabbit

  • Bug Fixes
    • Improved GPU replacement recovery so historical node-condition messages are cleared when stable GPU or PCI identities match.
    • Preserved GPU UUID matching when no stable hardware identity is available.
    • Ensured non-GPU event handling remains unchanged.
  • Tests
    • Added coverage for GPU identity handling, replacement recovery, UUID-only events, non-GPU entities, and clearing stale conditions after healthy hardware replacement.

Signed-off-by: Billard <82095453+iacker@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5c7d8e34-2505-4cdb-aaac-095a3b618102

📥 Commits

Reviewing files that changed from the base of the PR and between 4a21647 and 2fe000d.

📒 Files selected for processing (1)
  • platform-connectors/pkg/connectors/kubernetes/process_node_events.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • platform-connectors/pkg/connectors/kubernetes/process_node_events.go

📝 Walkthrough

Walkthrough

The Kubernetes connector now ignores GPU_UUID during GPU recovery matching when stable GPU or PCI identities exist. Tests cover replacement recovery, UUID-only events, non-GPU events, and removal of stale GPU conditions.

Changes

GPU replacement recovery

Layer / File(s) Summary
Stable identity recovery matching
platform-connectors/pkg/connectors/kubernetes/process_node_events.go
Recovery matching uses recoveryEntities. GPU events with stable GPU or PCI identities exclude GPU_UUID; other events retain all impacted entities.
GPU replacement recovery validation
platform-connectors/pkg/connectors/kubernetes/k8s_platform_connector_test.go
Tests cover stable identity selection, UUID-only fallback, unchanged non-GPU entities, and removal of conditions containing the old GPU UUID.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2fe00

The PR makes a localized GPU recovery behavior change with no actionable merge-blocking risk remaining beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant HealthyGPUEvent
  participant processNodeEvents
  participant recoveryEntities
  participant NodeCondition
  HealthyGPUEvent->>processNodeEvents: submit healthy GPU event
  processNodeEvents->>recoveryEntities: derive recovery entities
  recoveryEntities-->>processNodeEvents: return stable GPU and PCI identities
  processNodeEvents->>NodeCondition: remove matching fault message
Loading

Suggested reviewers: deesharma24

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the GPU replacement recovery fix addressed by the changes.
Linked Issues check ✅ Passed The changes satisfy issue #1585 by matching stable GPU or PCI identities and preserving UUID-only and non-GPU behavior.
Out of Scope Changes check ✅ Passed The implementation and tests remain focused on GPU replacement recovery and related entity-matching behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@XRFXLP

XRFXLP commented Aug 14, 2026

Copy link
Copy Markdown
Member

/ok to test 4a21647

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/nvidia/nvsentinel/platform-connectors/pkg/connectors/kubernetes 88.92% (+0.39%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/nvidia/nvsentinel/platform-connectors/pkg/connectors/kubernetes/process_node_events.go 93.44% (+0.25%) 381 (+14) 356 (+14) 25 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/nvidia/nvsentinel/platform-connectors/pkg/connectors/kubernetes/k8s_platform_connector_test.go


hasStableGPUIdentity := false

for _, entity := range event.EntitiesImpacted {

@XRFXLP XRFXLP Aug 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need two for loops? If we loop over EntitiesImpacted just once we can collect all the "stable identities", and on exit it that is not empty then return?

Signed-off-by: Billard <82095453+iacker@users.noreply.github.com>
@iacker

iacker commented Aug 15, 2026

Copy link
Copy Markdown
Author

yeah, good call, one loop is enough. Done in 2fe000d.

I collect the entities and set hasStableGPUIdentity in the same pass, then return the original slice if the flag never got set:

hasStableGPUIdentity := false
entities := make([]*protos.Entity, 0, len(event.EntitiesImpacted))

for _, entity := range event.EntitiesImpacted {
    if strings.EqualFold(entity.EntityType, "GPU") || strings.EqualFold(entity.EntityType, "PCI") {
        hasStableGPUIdentity = true
    }

    if !strings.EqualFold(entity.EntityType, "GPU_UUID") {
        entities = append(entities, entity)
    }
}

if !hasStableGPUIdentity {
    return event.EntitiesImpacted
}

return entities

Only cost is we build the slice even when we end up not using it, which felt cheaper than walking the list twice.

TestRecoveryEntities still passes on all three cases with -race, including the one where the UUID has to stay.

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.

[Bug]: Node Condition recovery fails after GPU replacement because GPU_UUID changes

2 participants