cluster/dht: Correct min_free_disk behaviour

Problem:
Files were being created in subvol which had less than
min_free_disk available even in the cases where other
subvols with more space were available.

Solution:
Changed the logic to look for subvol which has more
space available.
In cases where all the subvols have lesser than
Min_free_disk available , the one with max space and
atleast one inode is available.

Known Issue: Cannot ensure that first file that is
created right after min-free-value is crossed on a
brick will get created in other brick because disk
usage stat takes some time to update in glusterprocess.
Will fix that as part of another bug.

Change-Id: If3ae0bf5a44f8739ce35b3ee3f191009ddd44455
BUG: 858488
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/4420
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
object-storage: yield during directory tree walks

Have the co-routine (greenlet) yield during long running directory
tree walks to avoid starving out other greenlets that might be
available to run.

A directory walk involves statting every file in the tree to get it
size. For large numbers of files, this can get expensive. So we yield
after every stat call, and after processing every directory.

Change-Id: I07f1dfeef6a09b5817e0c237ecc748c491d52a31
BUG: 894674
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4380
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Tested-by: Mohammed Junaid <junaid@redhat.com>
tests: Made changes to verify if any of the bricks crashed

Change-Id: I9da3b8a490159b1090a803b74d0058be0d884c94
BUG: 905864
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4461
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Indexed node information in dict to retain consistency.

Problem:
--------
Depending on the response time from different nodes, the response
dict for rebalance status was populated in  a FIFO manner, and
hence the output for the CLI was never consistent.

Fix:
----
Irrespective of the response time of the nodes, we now index the
entries in the response dict for rebalance status, in reference
to the peerlist. So, the order of the entries and hence the CLI
output is always consistent.

Change-Id: Ica7e89e5d95aa9860a6f3c7eff58ca2052e05bd6
BUG: 888390
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/4416
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
geo-rep / gsyncd: Separate log file directory for Mountbroker sessions

... so that a mountbroker session which is initiated b/w master
and slave does not use the same log file if it's started after
a normal geo-rep session b/w master and slave. This results in
EPERM as the log file is owned by root and the geo-rep slave
process (now running as a non privileged user) does not have
access to it.

Also, having separate log file directory for mountbroker sessions
looks clean.

NOTE: geo-rep's client mount log file location remains unchanged.

Change-Id: Ic7a732e250aee5393b9c3f6ebf6dfe2c310b7fe4
BUG: 893960
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/4407
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: "volume heal info" doesn't report output properly

Problem: "volume heal info" doesn't reports files to be healed when gluster*
         processes on one of the storage node is not running

Change-Id: Iff7d41407014624e4da9b70d710039ac14b48291
BUG: 880898
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/4371
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
group-virt: Change profile to include remote-dio and exclude posix-aio.

remote-dio enables filtering O_DIRECT in the client xlator. This has been
found to be useful for improving performance when there are multiple VMs
talking to an image store.

Aggregated throughput results for a single thread iozone run from multiple VMs
and a single host can be seen below:

-------------------------------------------------
No. of VMs |   remote-dio on  |   remote-dio off |
-------------------------------------------------
       2   |     400 MB/s     |    202 MB/s      |
       4   |     650 MB/s     |    410 MB/s      |
--------------------------------------------------

posix-aio has not been found to improve performance consistently with VM image
workload. Hence not including that in the default virt profile.

Change-Id: I592f68b95a955036f1a985352d2f4950ced1deef
BUG: 907301
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/4460
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
glusterd: log changes in volume create and delete codepath

Making log changes involving two commands as they both share sections
of code (like the part where the volume metadata is cleaned up in vol
delete in case of success; and in vol create in case of failure).

* Most of the changes are of the 's/THIS/this' kind.

* Changed some of the log messages to give as much information as
  available in case of failure.

* Changed log levels in some of the log messages.

Change-Id: I10242511fe9400a07ab04717464d748d9172dd85
BUG: 812356
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/4462
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: remove extra call to glusterd_volume_compute_cksum()

In the commit phase of volume create, checksum on volinfo is
computed twice - once in the call to glusterd_store_volinfo() and once,
further down, in the same function glusterd_op_create_volume().

Change-Id: I36f9426943cd48937d4946b4b4ef09f19f31d888
BUG: 812356
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/4463
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>