glusterd: Make the changes work only for version above 3.6

Change-Id: Idb0246e90592b7a8efc21a5aba92bbfedfd60906
Signed-off-by: Varun Shastry <vshastry@redhat.com>
glusterd/snapshot: Fixed errmsg and Quorum check in Snapshot Operation

1) Removing the static message "unbarrier brick opfailed" and log
errors / message in places.
2) Calling the Snapshot Volume Quorum check if the commit
is passed, as the check(which checks the sanity of
glusterds or snapvolume) a successful commit makes more sense.

Change-Id: I7b8f77aa9b2e553893a6ae71bd4b5bbbb60ab8f1
BUG: 1112559
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/8158
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd : Coverity fix in __server_getspec

spec_fd handle should be closed in all the possible cases
CID : 1124768
Change-Id: I28390dc76a646a19258520570acef562b8d6fb1e
BUG: 789278
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/8091
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
glusterd/snapshot: Correct the mount path check

Before removing a lvm, we check if the lvm is mounted
on the brick path. If not, we remove the brick path only.
Correcting this check to support restore cases, where the
volname is not the non-hyphanated uuid, but the original
volume's name.

Change-Id: If158f4651d36efa2f94523458faf826230e9c76a
BUG: 1113975
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/8192
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Tested-by: Justin Clift <justin@gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
features/gfid-access: Handle loc modification correctly for virtual dirs

Change-Id: I6e3321534dc2f711519b18e8bffb691ab952a8ba
BUG: 1112659
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8163
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
libglusterfs: Ref root inode only once

Change-Id: I75f309fc1fabb17c392697205b2b5cae6d855e72
BUG: 1113437
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8182
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
quotad: Remove dead code

client_t is created by server xlator for managing connection related
resources. Quotad doesn't do that. So no need to handle anything related
to it.

Change-Id: I83e6f9e1c57458d60529dc62086bb63642932d49
BUG: 1113403
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8180
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
tests: Trigger dir heal by lookup

Heal full in v2 needs some improvements which Ravi
is working on. Fixed the script to heal based on lookup
from mount until then.

Change-Id: I7b5f8a294019d9f8cfc9c2346d7997f31b4c3d7c
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8178
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
geo-rep: Fix the fd leak in worker/agent spawn

worker and agent uses pipe to communicate, if worker dies
for some reason agent should get EOF and terminate.

Each worker-agent spawning is done in thread, Due to race
if multiple workers in same node retain the pipe refs of
other workers. Hence agent will not get EOF even if
worker dies.

BUG: 1114003
Change-Id: I36b9709b9392299483606bd3ef1db764fa3f2bff
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/8194
Tested-by: Justin Clift <justin@gluster.org>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
debug/io-stats: Free conf on init failures

Change-Id: I1d227f7b2b8f8ad8d44df8711654ee885e79cf38
BUG: 1111557
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8148
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
feature/changelog: Fix for missing changelogs at backend.

Problem:
       A few changelog files are missing at the backend
       during snapshot with changelog enabled.

Cause:
       Race between actual rollover and explicit rollover.

       Changelog rollover can happen either due to actual
       or the explict rollover due to snapshot. Actual
       rollover is controlled by tuneable called rollover-time.
       The minimum granularity for rollover-time is 1 second
       Explicit rollover is asynchronous in nature and happens
       during snapshot.

       Basically, rollover renames the current CHANGELOG file
       to CHANGELOG.TIMESTAMP after rollover-time. Let's assume,
       at time 't1', actual and explicit rollover raced against
       each other and actual rollover won the race renaming the
       CHANGELOG file to CHANGELOG.t1 and opens a new
       CHANGELOG file. An immediate explicit rollover at time
       't1' happened with in the same second to rename
       CHANGELOG file to CHANGELOG.t1 resulting in purging the
       earlier CHANGELOG.t1 file created by actual rollover.

Solution:
       Adding a delay of 1 sec guarantees unique CHANGELOG.TIMESTAMP
       during explicit rollover.

Thanks Venky, for the all the help in root causing the issue.

Change-Id: I8958824e107e16f61be9f09a11d95f8645ecf34d
BUG: 1109692
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8196
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
mgmt/glusterd: display snapd status as part of volume status

* Made changes to save the port used by snapd in the info file for the volume
  i.e. <glusterd-working-directory>/vols/<volname>/info

This is how the gluster volume status of a volume would look like for which the
uss feature is enabled.

[root@tatooine ~]# gluster volume status vol
Status of volume: vol
Gluster process                                         Port    Online  Pid
------------------------------------------------------------------------------
Brick tatooine:/export1/vol                             49155   Y       5041
Snapshot Daemon on localhost                            49156   Y       5080
NFS Server on localhost                                 2049    Y       5087

Task Status of Volume vol
------------------------------------------------------------------------------
There are no active volume tasks

Change-Id: I8f3e5d7d764a728497c2a5279a07486317bd7c6d
BUG: 1111041
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8114
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
mgmt/glusterd: use the right rpc for snapd while getting pending node rpc

* Also changed the testcase bug-1111041.t to correctly get the snapshot
  daemon's pid

Change-Id: I22c09a1e61f049f21f1886f8baa5ff421af3f8fa
BUG: 1111041
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8209
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Use gd_peer_has_address instead of strcmp

Change-Id: Ibe6eeff6a71401c6c6d7d8a48bf7c004b622e7e9
New utility gf_compare_addrinfo

Change-Id: I8ea694df480b2cb0f71809d0f696d06b68b5aab3
Improve glusterd_friend_find_by_hostname

glusterd_friend_find_by_hostname will now do an initial quick search for
the peerinfo performing string comparisions on the given host string. It
follows it with a more thorough match, by resolving the addresses and
comparing addrinfos instead of strings.

Change-Id: I092e88bb05f964a23e2f444349e8c4a7a249496b
geo-rep: History Change detector method select issue

Geo-rep does history crawl even if change-detector is set
to xsync.

This patch fixes by taking priority to user configured
change detector.

BUG: 1113525
Change-Id: Ic6c34e187c9cb6608c9ef8a010ea07015ba60a80
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/8183
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>