Put _check_key_is_zero_filled outside _xattrop_index_action

Change-Id: Ifb89a3a911213b2816a540a104558e7c3c13e23a
BUG: 874498
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/4182
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libglusterfs: implement gf_strndup

Change-Id: Ifb7bf22e8cf4ad1faccf7999c36919693912093f
BUG: 808400
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/4135
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cluster/afr: check transaction type for eager-lock after it is set

Problem:
Eager locking lk-owner decision is taken before transaction
type is set. Default transaction type is DATA so all transactions
are treated as DATA transactions at the time of eager-locking
decision.

Fix:
Move the code that takes lk-owner decision after the transaction
type is set.

Test:
Checked that the transaction type is set properly in gdb at
the time of the lk-owner decision.

Change-Id: I7607c7ff4f88c7ced5416a1cddb6586cf45d88f9
BUG: 861335
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4220
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
perf/io-threads: least-rate-limit least priority throttling

The 'least-rate-limit' io-threads translator option enables
throttling of least priority operations. This is initially intended
as a debug/diagnostic tool for users who might experience
overloaded servers via background activity (i.e., self-heal).

least-rate-limit defines the maximum number of least priority
operations the io-threads translator will dequeue in one second.
If the specified rate limit is met, the worker threads sleep for
the minimal amount of time before the next least priority operation
becomes available (or until a new request arrives).

The requests/second metric is generic and relative to a variety of
factors involved with a background operation (server, storage,
etc.). The most recent measured rate ("cached least rate") is added
to the io-threads state dump content (kill -USR1) to serve as a
reference point to throttle background activity under particular
conditions.

Change-Id: I80f2282992137d57b1becaa5c6ae3858c066862a
BUG: 853680
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/4119
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Don't ignore all files that match (*o|*la|*lo)

This has been hiding files in my tree, in particular, new directories that end
with an "o". I am guessing here that these are really trying to just ignore
.o, .la and .lo files.

Change-Id: Ic438ca5c43188a63e9840512825f9ba05c359eeb
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4195
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
object-storage: del 1.4.8 ref from dir hierarchy

Remove the "swift/1.4.8" directory from the hierarchy, replacing it with "ufo".

Change-Id: I60ba171182d7402a2193616c1c95c90cd2ead5bc
BUG: 870589
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4200
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
gsyncd / geo-rep: include hostname in status cmd

Including hostname of the node where geo-rep start was
initiated from. This helps any consumers of the status
command to identify and possibly issue commands on those
node(s).

Change-Id: I005083878a3a4794da3b7f3f7d2cc9d28f004e3f
BUG: 858218
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/4218
Reviewed-by: Csaba Henk <csaba@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
object-storage: Add a sorted list comparison to test

After the commit b0cb7aaf for bz#870589, which adds 2 tarballs
with layout patterns, Swift tests sometimes fail (depending on the
kind of filesystem they are running at and the phase of the moon).

As pattern tarball is unpacked, the underlying filesystem is free
to return directory listings in any order, and straightforward use
of '==' operator fails. As it turns out, one of the two comparisons
had set() applied to the list already. So, add it to the other one.

BUG: 874390
Change-Id: I02de99593b9567a13076113d58e242b079fde002
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-on: http://review.gluster.org/4165
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Peter Portante <pportant@redhat.com>
Use more portable mkstemp() instead fo mkostemp()

mkostemp() with O_CREAT|O_EXCL|O_RDWR|O_TRUNC|O_APPEND is mkstemp()
and mkstemp() is available on more systems than mkostemp()

NULL-commit to cause jankins ro rebuild

BUG: 764655
Change-Id: I6ee0f635d3699bd70b0963b24af07bd7d5c2dc58
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/4152
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cli: XML output for "geo-replication <VOL> {start|stop}"

Change-Id: I8d2213cc00deb458fb765b848d0e3452574cc98f
BUG: 864499
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4217
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
socket: fix double-free when ssl_setup_connection fails

Change-Id: I893b166da28f4c21e582ed477399c4bc0c1d20e1
BUG: 877903
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4208
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: brick path availability check only for local bricks

Change-Id: Ica50fb92608f5fd75f8887e0718177faf29d31c4
BUG: 877522
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4203
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: fix use of undefined realpath(3) result

Change-Id: Ic50ae192c99cece25cd63f2277fb440fca5f0b04
BUG: 877522
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4201
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
libglusterfs: Implement float percentage

Change-Id: Ia7ea63471f0bbd74686873f5f6f183475880f1a0
BUG: 839595
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/4162
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
mgmt/glusterd: Implementation of server-side quorum

Feature-page:
http://www.gluster.org/community/documentation/index.php/Features/Server-quorum

Change-Id: I747b222519e71022462343d2c1bcd3626e1f9c86
BUG: 839595
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3811
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
tests: Add volume utils in a new file

Change-Id: Ie78d24ca466d4bddc5c0727ed8ed51707e1f2a34
BUG: 839595
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4228
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
tests: Add volume set tests for quorum

Change-Id: I83e0408d8fd01afe990ebf634a8a09ea0b8ea54d
BUG: 839595
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4229
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
nfs: avoid blocking lock calls in statedump code

This change replaces LOCK () with TRY_LOCK () in
nlm statedump code.

Change-Id: I28c558b68854cf08c3a8190a00d6e3d507317628
BUG: 843819
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.org/4193
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Cluster/afr: Fix output for gluster volume heal vn info healed

Problem:
Whenever gluster volume heal vol full command is executed, the entries
stored in the circual buffer for sh->healed are added in the dictionary
in the _crawl_post_sh_action function irrespective of whether actual self heal
(due to non-zero values in chage log) takes place or not.

Fix:
Value of key (actual-sh-done) will be set to 1 whenever self heal takes place
due to non-zero change log values and if for some FOP self heal daemon finds
that no self heal required after examining the pending matrix, the value will
be 0.

Change-Id: I11fd0b9ee76759af17c5bca6bfafbaf66bcaacbc
BUG: 863068
Signed-off-by: Venkatesh Somyajula <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/4181
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
replicate: don't stop checking xattrs because one was absent

The functional issue is described by the subject line.  This patch also
addresses several efficiency/structure issues, such as...

* Calling dict_set_ptr once for each txn type, instead of once overall.

* Calling afr_index_for_transaction_type once per iteration instead of
  once per call (or better yet zero since the conversion is unnecessary).

* Implementation of inner functions in a different file than their one
  caller, creating a spurious header-file dependency.

Change-Id: I29e0df906a820533b66b9ced73e015dfe77267d2
BUG: 865825
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4070
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>