[dm-devel] RE: [PATCH 0/4] scsi_dh: Make scsi_dh_activate asynchronous

Hannes Reinecke hare at suse.de
Fri Oct 9 14:55:39 UTC 2009


Moger, Babu wrote:
> Hannes, Thanks again for the response..  Please see the comments below..
>  
>> Moger, Babu wrote:
>>> 1. Run I/O on both these Luns
>>> 2. Pull the cable connected to controller A.
>>> 3. Failover will happen and Lun 0 will move to controller B. Now both
>> the Luns are on controller B.
>>> 4. Connect the cable back on controller A.
>>> 5. multipath tool will detect the physical Luns on controller A and
>> run the priority test.
>>> 6. It will find that Lun 0 is not on preferred path and will initiate
>> a failback.
>>>    Because it is a controller level failover it will move the Lun 1
>> also to controller A.
>>>    Now both the Luns are on controller A.
>>> 7. Multipath tool will come again and find Lun 1 not on preferred
>> path and initiate failback.
>>>    This will both the Luns to controller B.
>>>    This will continue forever.
>>>
>> Hmm. Yes, correct.
>> After all, the patch I sent was meant to be a proof of concept, not a
>> fully fledged
>> solution. (In fact, I'm quite surprised it worked so well :-)
>>
>> What about modifying the LUN select code to switch all _visible_ LUNs
>> (ie all LUNs which
>> are _not_ on the preferred path) in one go?
>> That way we wouldn't run into this issue.
> 
> In this case handler should be able to do two tasks.
> 1. move all the Luns when one of the path failed(failover)
> 2. move only the luns which are not there on preferred path(failback).
> 
> With the current code rdac_activate(struct scsi_device *sdev) we cannot make that decision.
>  There is no information passed from dm layer to know if this command is for task 1(failover) or task 2(failback). 

Correct, but we don't need to.
We can detect the preferred path bit and use that to make this decision.
When the preferred path bit is not set for this LUN, we're switching _from_ the preferred path.
So chances are quite good that we're in failover mode and should transfer all LUNs.
When the preferred path bit is set, we're switching _to_ it and we're in failback mode.
So we should be transferring this path only; reasoning here is that failback is
triggered from the daemon and is running asynchronously anyway. So it doesn't really
matter how long this will take.

So something like the attached patch should work.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rdac-failover-all-luns
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20091009/62b2f7d7/attachment.ksh>


More information about the dm-devel mailing list