[Gluster-users] While running a rebalance, what does the metric "layout" represent

Amar Tumballi amar at gluster.com
Fri Mar 4 00:30:03 PST 2011

Hi James

Answer below,

> While monitoring it, the output of:
>        gluster volume rebalance pfs-rw1 status
> gives something similar to:
>        rebalance step 1: layout fix in progress: fixed layout 4865
> What does the number (in this case) 4865 represent, and what exactly does
> "layout" refer to?
First, the number represent the number of directories.  About 'layout', as
Joe mentioned, its the information about how the hash ranges are spread in
the volume for particular directory.

Let me try to make it more clear. Assume you have a distribute volume with 4
bricks (even a distribute-replicate volume will have distribute and layout
still holds good). Now, when you create a directory, it gets created in all
the 4 bricks, and now, when a file has to be created in that particular
directory, it has to go in one of the 4 bricks. This decision is based on 2
things. One is the 'hash' value of the basename of the file. second is the
information on which hash range should go to which brick (which is preserved
in directory and we call it 'layout').

Now, when 2 more bricks gets added, the directory structure gets self-healed
in that, but if you create the files inside the directory (existing
directory), it will still be distributed in only earlier 4 bricks, and will
not goto the newly added bricks. This is because the layout structure is
static for a given directory. Now, when we do 'rebalance' we have to first
fix this layout information so that the files can actually go to newly added
nodes. That is done by an internal command, and once this happens, all the
file stat information which are already cached will get revalidated (and you
see a log in client log file for 'mismatching layout').

Hope this answers some of the questions. I will try to come up with the
better documentation of the process and will get it added to the gluster


More information about the Gluster-users mailing list