Closed shay-berman closed 6 years ago
besides the license headers?
Review status: 0 of 8 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.
fakes/fake_block_device_mounter_utils.go, line 1 at r2 (raw file):
// Code generated by counterfeiter. DO NOT EDIT.
Did you remove the license header? Why does it look that way?
fakes/fake_block_device_utils.go, line 1 at r2 (raw file):
// Code generated by counterfeiter. DO NOT EDIT.
same here, what happened to the license header?
Comments from Reviewable
Review status: 0 of 8 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.
fakes/fake_block_device_mounter_utils.go, line 1 at r2 (raw file):
Did you remove the license header? Why does it look that way?
all files with "fake" names are generated automatically by go Counterfeiters. its a moking system. its not our code its self generated. no sense to put there license because it will always be overwritten by couterfeiter.
agree?
fakes/fake_block_device_utils.go, line 1 at r2 (raw file):
same here, what happened to the license header?
same as above
Comments from Reviewable
Testing update about this PR:
So, we decided to merge this PR into dev branch.
Improve performance by skip discover devices by sg_inq during the attach flow (create POD).
Description: In case you have many devices on the worker nodes and you create a new POD with PVC, before this fix the discover would go on all the PVCs devices on the node and trigger sg_inq on each one of them in order to search for the device for the new PVC (wwn). Well in most use cases there is no need to do this overhead during attach since the device probably doesn't exist on the host or if it is then it should appear in multipath -ll already. So to improve performance we decided to skip this deepDiscovery(by sg_inq on all the devices). And it will already be covered anyway after the rescanAll.
Improve discovery performance by applying the following things:
Do NOT do sg_inq deepDiscovery during the RescanAll in the attach flow. Its waist of time to do deepDiscovery in this case, since its already done after the RescanAll when discovering the new device.
Do sg_inq deepDiscovery only in the following cases: 2.1. During the attach after the RescanAll 2.2. When Discover for cleanup(unmount flow).
Remove double sg_inq validation if discover during deepDiscovery
Remove Stat(mpath) validation during Discover, since its already validated during GetWwnByScsiInq() or DiscoverBySgInq()
Fix interfaces, UT and fakes according (Still need to add more UT)
In addition this PR improve the DiscoverBySgInq by searching only IBM devices(devices with "IBM" vendor tag presented in multipath -ll). A side affect of this filtering is that it will not work on faulty devices that usually doesn't present any Vendor tag on.
How to test
create POD1 with PVC1 and check in the flex logs that the volume didn't had to discover using DiscoverBySgInq, means you should see the message "mpath device was NOT found for WWN [%s] in multipath -ll"(where %s is the wwn of the PVC). but you should not see any try to run sg_inq on this WWN (debug for GetWwnByScsiInq with this mpath device)
Try to get in multipath -ll with bad devices, then run create POD2 with PVC2, this this case there is high chance that multipath -ll will not present the right WWN for the new PVC2 device. if so then you should see in the log that flex tried to identify this PVC2 device by using sg_inq. You can see in the log message like "Warning: device [%s] found for WWN [%s] after running sg_inq"
This change is