Closed tzurE closed 6 years ago
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion.
remote/mounter/block_device_utils/mpath.go, line 87 at r1 (raw file):
} if _, err = b.exec.Stat(mpath); err != nil { return "", b.logger.ErrorRet(err, "Stat failed")
I know it's not in this code change but can we do better with this error message? Stat failed for volume [%s] ?
Comments from Reviewable
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion.
Comments from Reviewable
Review status: 0 of 3 files reviewed at latest revision, 6 unresolved discussions.
remote/mounter/block_device_utils/errors.go, line 47 at r1 (raw file):
} type wrongVolumeFoundError struct {
rename to wrongDeviceFoundError
remote/mounter/block_device_utils/errors.go, line 49 at r1 (raw file):
type wrongVolumeFoundError struct { volName string reqVolName string
Add also the dev path as argument
remote/mounter/block_device_utils/errors.go, line 52 at r1 (raw file):
} func (e *wrongVolumeFoundError) Error() string { return fmt.Sprintf("volume [%v] is not found. instead found vol [%s].", e.reqVolName, e.volName)
fix it to "multipath device [%s] was found as WWN [%v] via multipath -ll command, BUT sg_inq identify this device as different WWN [%s]. Check your multipathd."
remote/mounter/block_device_utils/mpath.go, line 79 at r1 (raw file):
GetWwnByScsiInq please call the var, SqInqWwn
remote/mounter/block_device_utils/mpath.go, line 84 at r1 (raw file):
} if strings.ToLower(wwn) != strings.ToLower(volumeWwn){ return "", b.logger.ErrorRet(&wrongVolumeFoundError{wwn, volumeWwn}, "failed")
please add here also dev as argument to see the whole picture not only the WWN
Comments from Reviewable
Review status: 0 of 3 files reviewed at latest revision, 6 unresolved discussions.
remote/mounter/block_device_utils/errors.go, line 47 at r1 (raw file):
rename to wrongDeviceFoundError
Done.
remote/mounter/block_device_utils/errors.go, line 49 at r1 (raw file):
Add also the dev path as argument
Done.
remote/mounter/block_device_utils/errors.go, line 52 at r1 (raw file):
fix it to "multipath device [%s] was found as WWN [%v] via multipath -ll command, BUT sg_inq identify this device as different WWN [%s]. Check your multipathd."
Done.
remote/mounter/block_device_utils/mpath.go, line 79 at r1 (raw file):
> GetWwnByScsiInq please call the var, SqInqWwn
Done.
remote/mounter/block_device_utils/mpath.go, line 84 at r1 (raw file):
please add here also dev as argument to see the whole picture not only the WWN
Done.
Comments from Reviewable
Review status: 0 of 3 files reviewed at latest revision, 5 unresolved discussions.
remote/mounter/block_device_utils/block_device_utils_test.go, line 177 at r2 (raw file):
Expect(err.Error()).To(MatchRegexp(cmdErr.Error())) }) It("Discover fails if wrong wwn is found", func() {
very good UT
remote/mounter/block_device_utils/block_device_utils_test.go, line 199 at r2 (raw file):
cmd, args = fakeExec.ExecuteArgsForCall(1) Expect(cmd).To(Equal("sg_inq")) Expect(args).To(Equal([]string{"-p", "0x83", "/dev/mapper/mpath"}))
not must, but its better to use the "/dev/mapper/" + result
remote/mounter/block_device_utils/errors.go, line 52 at r1 (raw file):
Done.
Do you think we should tell Dima to add this string to the troubleshooting section in the userguide?
remote/mounter/block_device_utils/mpath.go, line 87 at r1 (raw file):
I know it's not in this code change but can we do better with this error message? Stat failed for volume [%s] ?
the err it should will be find not found. so i think we are ok here. But yes we can add here "Stat fileX failed". BTW this is the same Stat we should do after remove the multipath device.
Comments from Reviewable
Review status: 0 of 3 files reviewed at latest revision, 5 unresolved discussions.
remote/mounter/block_device_utils/block_device_utils_test.go, line 199 at r2 (raw file):
not must, but its better to use the "/dev/mapper/" + result
Done.
remote/mounter/block_device_utils/errors.go, line 52 at r1 (raw file):
Do you think we should tell Dima to add this string to the troubleshooting section in the userguide?
yes
Comments from Reviewable
In order to provide more confident that the mpath device we discover in multipath -ll, we added double validation that the WWN behind the discovered mpath device is really the WWN that we expect it to be. This way we sure(by getting the WWN directly from the device) that we going to mount the expected device.
This PR provide another layer of validation that we are using the right device.
This change is