|
From: | Pavan T C |
Subject: | Re: [Gluster-devel] One Question about DHT |
Date: | Wed, 17 Aug 2011 15:08:27 +0530 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 |
On Wednesday 17 August 2011 09:18 AM, Daniel wrote:
Hello Pavan, I came cross one question about DHT lookup. When dht_lookup process a fresh lookup, if the looked up target can not be found by hashed, why does it assert it as a directory and lookup on all the child nodes?
Not sure why you thought I should be the one to address this to. There are more knowledgeable engineers on this user group :)
I looked up the code a bit to answer your question and here is what I understand:
If it is a fresh lookup and the file hash computed for this entity did not fall into any of the pre-computed hashed ranges, a lookup_everywhere is triggered to go to the backend and see if it exists there. If it is not there too, this brings in a mechanism called "directory self heal".
The debug message does say - "see if it is a directory", but if you look at the dht_lookup_dir_cbk, a check is also made to see if it was *not* a directory. It might only be the debug messages that might have led you into thinking why a directory is being looked up in particular. That is not really the case.
Pavan
Thanks Dan
[Prev in Thread] | Current Thread | [Next in Thread] |