Skip to content

controller/blockdevice: should update DevPath once it changed #195

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
merged 1 commit into from
May 8, 2025

Conversation

Vicente-Cheng
Copy link
Collaborator

- when the node reboot, it might cause the device path change because of the interrupt order with the device. We need to update the device path once it changed.

Problem:
Sometimes we will see the duplicated status.deviceStatus.devPath of the blockdevice CR in the same node.

The device path would be change in following two cases:

  1. device is temporarily gone and back.
  2. Node reboot might also cause the device path change (depends on device interrupt).

So, we need to update the device path once it has changed

Solution:
Update device path once it has changed

Related Issue:
harvester/harvester#8164

Test plan:
Try to reboot, and you might see the spec.devPath is different from status.deviceStatus.devPath.
NOTE: It is hard to reproduce so that we can focus on the general use case, which should be kept the same.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue where the BlockDevice's devPath may change unexpectedly after a node reboot or when the device is temporarily removed. The changes update the BlockDevice's status by reflecting the new devPath and activating an inactive device when it returns.

  • Update the device path when a change is detected.
  • Change the device state from Inactive to Active if applicable.
  • Modify error handling by signaling the scanner upon update failure.

    - when the node reboot, it might cause the device path change
      because of the interrupt order with the device. We need to
      update the device path once it changed.

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
@Vicente-Cheng Vicente-Cheng force-pushed the correct-status-dev-path branch from 09c128f to 6716553 Compare May 7, 2025 19:21
@Vicente-Cheng
Copy link
Collaborator Author

@Mergifyio backport v1.5

Copy link

mergify bot commented May 7, 2025

backport v1.5

✅ Backports have been created

Copy link
Contributor

@tserong tserong left a comment

Choose a reason for hiding this comment

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

LGTM. Just one question...

Copy link
Member

@brandboat brandboat left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@brandboat brandboat merged commit 65b1ca6 into harvester:master May 8, 2025
8 checks passed
@Vicente-Cheng
Copy link
Collaborator Author

@Mergifyio backport v0.7.x

Copy link

mergify bot commented May 8, 2025

backport v0.7.x

✅ Backports have been created

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