Skip to content

Fix nvme block resize#366

Merged
rishabhatdell merged 4 commits into
mainfrom
bugfix-1534-nvme-block-resize
Oct 25, 2024
Merged

Fix nvme block resize#366
rishabhatdell merged 4 commits into
mainfrom
bugfix-1534-nvme-block-resize

Conversation

@AkshaySainiDell

@AkshaySainiDell AkshaySainiDell commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

Description

Fix nvme block resize.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
https://github.com/dell/csm/issues/1534

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Tested with PowerStore
    image

@AkshaySainiDell AkshaySainiDell marked this pull request as ready for review October 25, 2024 11:17

@donatwork donatwork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did the test that you mentioned fail prior to this fix? Is it a cert-csi test that was added or was it always failing?

Comment thread pkg/node/node.go
Comment on lines +997 to +1000
nvmeControllerDevice, err := s.Fs.GetUtil().GetNVMeController(deviceName)
if err != nil {
log.Errorf("Failed to rescan device (%s) with error (%s)", deviceName, err.Error())
return nil, status.Error(codes.Internal, err.Error())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would the GetNVMeController() call fail? Is bailing out the proper handling? Could anything else be done? The error message is inaccurate and can cause problems during troubleshooting. Is it better to indicate that there was a failure to get the device controller?

Comment thread pkg/node/node.go
log.Errorf("Failed to rescan device (%s) with error (%s)", deviceName, err.Error())
return nil, status.Error(codes.Internal, err.Error())
}
if nvmeControllerDevice != "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So there seems to be a place where nvmeControllerDevice can be empty but GetNVMeController() returns no error. Is this code still then correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For PowerMax, we have two devices: nvme0c0n1 and nvme0n1.
image

Here, nvme0c0n1 is a controller, but nvme0n1 is not.

The GetNVMeController function processes each device as follows:

  1. nvme0c0n1 - Successfully returns the controller nvme0.
  2. nvme0n1 - print logger Not a valid nvme controller device: nvme0n1 and return empty nvmeControllerDevice

@rishabhatdell

Copy link
Copy Markdown
Contributor

Did the test that you mentioned fail prior to this fix? Is it a cert-csi test that was added or was it always failing?

The cert-csi test for block volume expansion was present, but it was giving false positive results. It only expanded the volume without actually validating if the expansion was successful. We've now added a check to wait for successful volume expansion events, ensuring that the volume has been properly expanded before considering the test a success.

@rishabhatdell rishabhatdell merged commit 2c45d65 into main Oct 25, 2024
@rishabhatdell rishabhatdell deleted the bugfix-1534-nvme-block-resize branch October 25, 2024 12:49
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