[Gluster-devel] files exist but readdir do not see them

Emmanuel Dreyfus manu at netbsd.org
Tue Jul 12 08:29:00 UTC 2011

On Mon, Jul 11, 2011 at 11:36:58AM +0000, Emmanuel Dreyfus wrote:
> I tried starting up from scratch: stop/delete/create/start the volume.
> I get exactly the same result.

I think I tracked down the problem. It happens in dht_deitransform()
As I understand, this function decides which subvolume is to use given
an offet to readdir. Here is the important code:

        cnt = y % max;
	x   = y / max;
	subvol = conf->subvolumes[cnt];

y is the offset requested in the readdir call, max is the amount of
subvolumes. When I do ls /gfs/misc, two readdir operations are sent, 
and I get this:

	1st call: y = 0, cnt = 0, max = 2, x = 0
	2nd call: y = 776, cnt = 0, max = 2, x = 388

Therefore both readdir calls fetch data from the same subvolume, 
which explains why I never see the files from the other ones.

How is it supposed to work? I suspect there is some assumption on 
what offsets the client will use in readdir operations. Or did 
I misunderstood dht logic?

Emmanuel Dreyfus
manu at netbsd.org

More information about the Gluster-devel mailing list