Hello, Christine and Ja S.<br>I've been following this thread, because I need, like Ja, a detailed knowledge of the DLM inner workings. Your explanations were detailed and clear, Christine, but, just for the sake of having it documented, do you know where I can download a white paper or article telling this whole story?<br>
<br>Thanks in advance<br><br>Best,<br>Oliveiros<br><br><div class="gmail_quote">2008/5/13 Christine Caulfield <<a href="mailto:ccaulfie@redhat.com">ccaulfie@redhat.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Ja S wrote:<br>
> --- Christine Caulfield <<a href="mailto:ccaulfie@redhat.com">ccaulfie@redhat.com</a>> wrote:<br>
><br>
>> Ja S wrote:<br>
>>> --- Christine Caulfield <<a href="mailto:ccaulfie@redhat.com">ccaulfie@redhat.com</a>><br>
>> wrote:<br>
>>>> Ja S wrote:<br>
>>>>> Hi, All:<br>
>>>>><br>
>>>>><br>
>>>>> When an application on a cluster node A needs to<br>
>>>>> access a file on a SAN storage, how DLM process<br>
>>>> the<br>
>>>>> lock request?<br>
>>>>><br>
>>>>> Should DLM firstly determine whether there<br>
>> already<br>
>>>>> exists a lock resource mapped to the file, by<br>
>>>> doing<br>
>>>>> the following things in the order 1) looking at<br>
>>>> the<br>
>>>>> master lock resources on the node A, 2)<br>
>> searching<br>
>>>> the<br>
>>>>> local copies of lock resources on the node A, 3)<br>
>>>>> searching the lock directory on the node A to<br>
>> find<br>
>>>> out<br>
>>>>> whether a master lock resource assosicated with<br>
>>>> the<br>
>>>>> file exists on another node, 4) sending messages<br>
>>>> to<br>
>>>>> other nodes in the cluster for the location of<br>
>> the<br>
>>>>> master lock resource?<br>
>>>>><br>
>>>>> I ask this question because from some online<br>
>>>> articles,<br>
>>>>> it seems that DLM will always search the<br>
>>>> cluster-wide<br>
>>>>> lock directory across the whole cluster first<br>
>> to<br>
>>>> find<br>
>>>>> the location of the master lock resource.<br>
>>>>><br>
>>>>> Can anyone kindly confirm the order of processes<br>
>>>> that<br>
>>>>> DLM does?<br>
>>>>><br>
>>>> This should be very well documented, as it's<br>
>> common<br>
>>>> amongst DLM<br>
>>>> implementations.<br>
>>>><br>
>>> I think I may be blind. I have not yet found a<br>
>>> document which describes the sequence of processes<br>
>> in<br>
>>> a precise way. I tried to read the source code but<br>
>> I<br>
>>> gave up due to lack of comments.<br>
>>><br>
>>><br>
>>>> If a node needs to lock a resource that it<br>
>> doesn't<br>
>>>> know about then it<br>
>>>> hashes the name to get a directory node ID, than<br>
>>>> asks that node for the<br>
>>>> master node. if there is no master node (the<br>
>>>> resource is not active)<br>
>>>> then the requesting node is made master<br>
>>>><br>
>>>> if the node does know the master, (other locks on<br>
>>>> the resource exist)<br>
>>>> then it will go straight to that master node.<br>
>>><br>
>>> Thanks for the description.<br>
>>><br>
>>> However, one point is still not clear to me is how<br>
>> a<br>
>>> node can conclude whether it __knows__ the lock<br>
>>> resource or not?<br>
>> A node knows the resource if it has a local copy.<br>
>> It's as simple as that.<br>
>><br>
><br>
> If the node is a human and has a brain, it can<br>
> "immediately" recall that it knows the lock resouce.<br>
> However, for a computer program, it does not "know"<br>
> anything until it search the target in what it has on<br>
> hand.<br>
><br>
> Therefore, the point here is the __search__. What<br>
> should the node search and in which order, and how it<br>
> searches?<br>
><br>
> If I missed anything, please kindly point out so that<br>
> I can clarify my question as clear as possible.<br>
><br>
><br>
<br>
</div></div>I think you're trying to make this more complicated than it is. As I've<br>
said several times now, a node "knows" a resource if there is a local<br>
lock on it. That's it! It's not more or less difficult than that, really<br>
it isn't! If the node doesn't have a local lock on the resource then it<br>
doesn't "know" it and has to ask the directory node where it is<br>
mastered. (As I'm sure you already know, locks are  known by their lock<br>
ID numbers, so there's no "search" involved there either).<br>
<br>
There is no "search" for a lock around the cluster, that's what the<br>
directory node provides. And as I have already said, that is located by<br>
hashing the resource name to yield a node ID.<br>
<br>
So, if you like, the "search" you seem to be looking for is simply a<br>
hash of the resource name. But it's not really a search, and it's only<br>
invoked when the node first encounters a resource.<br>
<div><div></div><div class="Wj3C7c"><br>
Chrissie<br>
<br>
--<br>
Linux-cluster mailing list<br>
<a href="mailto:Linux-cluster@redhat.com">Linux-cluster@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/linux-cluster" target="_blank">https://www.redhat.com/mailman/listinfo/linux-cluster</a><br>
</div></div></blockquote></div><br>