glusterd: Fetch brick mount_dirs during brick create.

Fetch the mount directory path for a brick, during
volume create, add-brick, and replace-brick.

When a snap-create is missed, use this mount directory
information to create the brick path for the missed snap brick.

Change-Id: Iad3eec96a32cf340f26bdf3f28e2f529e4b77e31
BUG: 1061685
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7550
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snashot: Perform missed snap creates

When a brick is started, and the glusterfsd process requests
for volfile, the brick_name is sent in the req dict. In
glusterd, after fetching the spec the brick_name is looked
up in the missed_snap_list, and any missing snap creates on
the same brick are performed. After this, the glusterd
responds back with the specfile.

Also collate brick data from the node's hosting the bricks
during restore. In case the data is absent, the local node's
data is used. This is needed to ensure that, during a restore
we collect the information created when a missed snap create
is performed.

Change-Id: I47cefdeba96f2702be810965734cf0fac61d3d2d
BUG: 1061685
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7551
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd: Allow bumping up the cluster op-version

This patch allows a user to bump up the cluster op-version by doing
  # gluster volume set all cluster.op-version <OP-VERSION>

The op-version will be bumped only if
- all the peers in the cluster support it, and
- the new op-version is greater than the current cluster op-version

This set operation will not do any other change other than changing and
saving the cluster op-version in the glusterd.info file. It will NOT,
- change any existing volume
- add the option to the global options list
- fix the cluster op-version to the given version, it can be bumped up
  by other volume set commands.

Change-Id: I084b4fcc45e79dc2ca7b7680d7bb371bb175af39
BUG: 1092592
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/7603
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
rpc: don't stop sending ping packets to an active server.

- Removed an unnecessary ref on rpc_clnt object.
- Removed saved_frames_delete function, which was unused.

Change-Id: Ie8a9c4bb20c1fd59744b64b56eb043eca095e5e3
BUG: 1094655
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/7678
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
glusterd: Port server quorum messages to the gf_msg API

Change-Id: I84716cc07f3cbd8c1b2825a5676d6693fed6fade
BUG: 1075611
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/7578
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd: port network failure log messages to gf_msg API

Change-Id: I23df6d179e9d66a71721e9844a34c5b96586f90f
BUG: 1075611
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/7462
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
glusterd : Port glusterd sync log messages to gf_msg API

Change-Id: Ic3ed2c96d8fc3a15fedaa80517a2c79c0c858963
BUG: 1075611
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/7652
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
gsyncd / geo-rep: Initialize default memory accounting

commit 7fba3a8 enables memory accounting by default. Since
geo-replication binary (gsyncd) does not declare a memory
accounting function, call like GF_{CALLOC,MALLOC} result
int asserts.

This patch initializes default memory accounting.

Change-Id: I9ad1de8bca6745a9899a006a863a7cfeef73d52f
BUG: 1094708
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/7683
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: NFS server wrongly started with `DEBUG` log-level

Disable DEBUG

Change-Id: I011231ba3df4a42f892f1305867bfc74bb101269
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7654
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
mgmt/glusterd: quorum check before taking the snapshot

without force option:
quorum fails if glusterds are not in quorum. If glusterd are in quorum, then
volume quorum (i.e quorum of the bricks) is checked. volume quorum fails even if
one of the bricks are down.

with force option:
even though the glusterds are not in quorum, and some bricks are down, the
quorum check of the volume (i.e bricks) is done and if the volume quorum is
met, snapshot is taken.

Change-Id: I06971e45d5cf09880032ef038bfe011e6c244268
BUG: 1061685
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/7463
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
glusterd: Use a calloc-ed copy of txn_id for glusterd_do_replace_brick

As glusterd_do_replace_brick() is spawned through gf_timer_call_after(),
by the time it's called the event is freed, and the txn_id is lost.
Hence using a calloc-ed copy, which will be freed as a part of rb_ctx
dict.

Change-Id: I3e309fe1a7ba96ad1d1ce01f4d2aa18178f59244
BUG: 1095097
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7686
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
mgmt/glusterd: Perform Pending quorum actions after Op

Change-Id: I2bb67b5fb4a6f6dac892ef3206e7a79706018a6e
BUG: 959986
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4955
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
mgmt/glusterd: Prevent spurious brick restarts

Change-Id: I7ee5d18b926d6c31e3e4ea2f5fbe9050c8e1dee8
BUG: 959986
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/4954
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
libgfchangelog: memory accounting intialization

Needed as memory accounting turned ON by default now.
Without this, GF_{CALLOC,MALLOC} calls assert.

Change-Id: Ie54a6efb61871e70d4f7c796d9c86a867051e2e0
BUG: 1094708
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/7698
Reviewed-by: Kotresh HR <khiremat@redhat.com>
cluster/afr: Remove stale index in self-heal codepath

Change-Id: I635fc0fa955b33590f1c5b4dfec22d591ea8575c
BUG: 1032894
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6592
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Update Maintainers to reflect recent changes

Change-Id: I8dc3347d88942473810c2b4c9d52a69ecb6129e8
BUG: 1040351
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/7689
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Tested-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
runtime: Disable optimization for OSX versions < 10.9

Optimization flags has led to segfaults at wrong locations
throughout gluster code for versions < 10.9

Assuming this to be a compiler bug, disable optimization
flags

Change-Id: Ia2dc983dc5bb06935f03b68c07688ce41255d7da
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7656
Reviewed-by: Justin Clift <justin@gluster.org>
Tested-by: Justin Clift <justin@gluster.org>
glusterd/snapshot: Add brick-count suffix for the LVM snapshot

When there are more than one brick created from the same LVM volume
group, there will be a conflict with the LVM snapshot name we use.

Solution is to add a brick-count suffix to the LVM snapshot name

Change-Id: I7258e69fe0b50e86b81c66ab1db523ab3c7cbae0
BUG: 1091934
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/7581
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snapshot: Execute lvm snapshots in parallel

Back-end LVM Snapshot is executed parallely as synop task
This helps is gaining performance when there are more bricks in a
node.

This patch also removes unwanted logs printed in snapshot cleanup

Change-Id: I3174cb4547ebb670eca37a98eb9d75ecb0672a90
BUG: 1061685
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/7461
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snapshot: Don't release big_lock before completing snapshot creation

Releasing the big-lock can cause problem like deadlock or memory
corruption.

Same happened with bug 1091926 where glusterd on node-2 entered a commit
phase and released a big-lock.

The originator node received timeout for the commit phase and
triggered a post-validate cleanup to the node-2.

Now node-2 continued to work with the object that are alreday cleaned-up
and resulted in a crash.

Solution is to not to release big-lock in the commit phase of snapshot
creation.

Change-Id: I571194fdb0b0ecc91bd13f2a9fc92fe4338d14dc
BUG: 1091926
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/7579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>