[Gluster-devel] EHT / DHT

Shyam srangana at redhat.com
Tue Nov 25 19:55:51 UTC 2014


On 11/25/2014 02:28 PM, Jan H Holtzhausen wrote:
> I think I have it.
> Unless I’m totally confused, I can hash ONLY on the filename with:
>
> glusterfs --volfile-server=a_server --volfile-id=a_volume \
>     --xlator-option a_volume-dht.extra_hash_regex='.*[/\\\\]' \
>     /a/mountpoint
>
> Correct?

The hash of a file does not include the full path, it is on the file 
name _only_. So any regex will not work when the filename remains 
constant like "myfile".

As Jeff explains the option is really to prevent using temporary parts 
of the name in the hash computation (for rename optimization). In this 
case, you do not seem to have any tmp parts to the name, like "myfile" 
and "myfile~" should evaluate to the same hash, so remove all trailing 
'~' from the name.

So I am not sure the above is the option you are looking for.

>
> Jan
>
> From: Jan H Holtzhausen <janh at holtztech.info <mailto:janh at holtztech.info>>
> Date: Tuesday 25 November 2014 at 9:06 PM
> To: <gluster-devel at gluster.org <mailto:gluster-devel at gluster.org>>
> Subject: Re: [Gluster-devel] EHT / DHT
>
>>Are you referring to something else in your request? Meaning, you want
>
>>/myfile, /dir1/myfile and /dir2/dir3/myfile to fall onto the same
>
>> bricks/subvolumes and that perchance is what you are looking for?
>
>
> That is EXACTLY whatI  am looking for.
>
> What are my chances?

As far as I know not much out of the box. As Jeff explained, the 
directory distribution/layout considers the GFID of the directory, hence 
each of the directories in the above example would/could get different 
ranges.

The file on the other hand remains constant "myfile" so its hash value 
remains the same, but due to the distribution range change as above for 
the directories, it will land on different bricks and not the same one.

Out of curiosity, why is this functionality needed?

Shyam


More information about the Gluster-devel mailing list