Revert "tests/basic/rpm.t: run mock builds in parallel"

This reverts commit 91e8103794349ebdd578b77987a089456a59c52b

Reverting as regression tests are failing after this merge.

Change-Id: I9dcd430b2f9a431c3c01deab1a205aed297216a3
Reviewed-on: http://review.gluster.org/5842
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
glusterfsd: Round robin DNS should not be relied upon with
config service availability for clients.

Backupvolfile server as it stands is slow and prone to errors
with mount script and its combination with RRDNS. Instead in
theory it should use all the available nodes in 'trusted pool'
by default (Right now we don't have a mechanism in place for
this)

Nevertheless this patch provides a scenario where a list of
volfile-server can be provided on command as shown below

-----------------------------------------------------------------
$ glusterfs -s server1 .. -s serverN --volfile-id=<volname> \
      <mount_point>
-----------------------------------------------------------------
                   OR
-----------------------------------------------------------------
$ mount -t glusterfs -obackup-volfile-servers=<server2>: \
      <server3>:...:<serverN> <server1>:/<volname> <mount_point>
-----------------------------------------------------------------

Here ':' is used as a separator for mount script parsing

Now these will be remembered and recursively attempted for
fetching vol-file until exhausted. This would ensure that the
clients get 'volume' configs in a consistent manner avoiding the
need to poll through RRDNS.

Change-Id: If808bb8a52e6034c61574cdae3ac4e7e83513a40
BUG: 986429
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/5400
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
gfapi: store the open/create flags in fd_t object

The flags passed on to open and create calls were not being saved
in the fd_t object, hence the fd migration was failing.

Change-Id: I486bb818477fe4c393d64a711534a082162a0e53
BUG: 1005159
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/5837
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
parser: make the parser thread safe.

The volfile parser thread safe by guarding the parsing phase
in a mutex. Thread safety becomes a problem when there are multiple
glfs_t objects created by gfapi and all of them potentially parse
the respective volfiles at the same time.

Change-Id: I4376019c4956994b72397ab36e6ac3ce849797ec
BUG: 1004519
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5790
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.org>
rpm: fix "warning: File listed twice: .../glusterd.info"

Commit a482e422 added glusterd.info to the %files section of the
glusterfs-server package. However, this file was listed already. This
causes the following warning when building the RPMs:

    warning: File listed twice: /var/lib/glusterd/glusterd.info

Merging the attributes for /var/lib/glusterd/glusterd.info into one line
prevents this warning.

Change-Id: I0d518ec186a8725dc4c5cba00b60da83fdadf103
BUG: 1005161
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5836
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht: assign layout onto missing directories too

The current self-healing algorithm is ignoring missing directories
for assigning new layout. When lookup() is racing against mkdir()
or when self-healing a half-done mkdir(), the layout assignment split
must happen based on the final number of directories, and not the
currently existing number of directories (because we finish mkdir()
of missing directories before hash layout assignment).

Without this fix, concurrent mkdir() and lookup() will step on
each others feet, create a messed up layout on disk, and end up
with different in-memory layouts.

Once two clients have different in-memory layouts, creation of
subdirectory will not arbitrate on the same hashed subvolume and will
result in GFID mismatch of the sub-directory.

Change-Id: Ia47acad67c265060405984c822b4d37512b9dbb3
BUG: 907072
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5849
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Peter Portante <pportant@redhat.com>
glusterfsd: use-readdirp w/o arguments should not turn off readdirp

`use-readdirp` has an optional argument in argp -
specifying just `--use-readdirp` command line should not
'turn off' readdirp, since that undermines the meaning
of such an argument.

Change-Id: I965d87e29bd0d61997d9be96fa698e270a2ee173
BUG: 983477
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/5851
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: Added missing MY_UUID conversion in gsync staging

Change-Id: Ia4bf607e044d50636fb0a599a2ff91059f5b17aa
BUG: 1006177
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5887
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Allow bumping down a peer's op-version during probe

Earlier, a peer running a higher op-version couldn't be probed into a
cluster running at a lower op-version. This created issues when trying
to expand an upgraded cluster. This patch changes this behaviour.

The cluster no longer rejects a peer being probed if its op-version is
higher than the cluster op-version. The peer will reduce its op-version
if it doesn't have any volumes. If the peer contains volumes and needs
to reduce its op-version, it fails the handshake and the probe fails.

Change-Id: I12c6c873922799e1557b7184e956baea643d0dea
BUG: 1005038
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5715
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
tests/basic/rpm.t: run mock builds in parallel

save about six minutes per regression by building in parallel

Change-Id: Iaf6fa545e20b0322b10e9e4ab7cc3d4254a0ece5
BUG: 1006269
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5845
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
cli: Fix 'status all' xml output when volumes are not started

CLI now only outputs one XML document for 'status all' only containing
those volumes which are started.

BUG: 1004218
Change-Id: Id4130fe59b3b74475d8bd1cc8134ac59a28f1b7e
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5773
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
rpc/rpc-lib: rpcsvc should reply when rpc_err is set

Problem:
When requests are received on a connection before setvolume
is done, creating frame from the requests fail because there is
no association of the transport with the conn(i.e. xl_private).
xl_private is set only on set_volume. In such cases error response
is not sent from server xlator to that request because of which
operations on mount point are hanging.

Fix:
Set actor return value to RPCSVC_ACTOR_ERROR so that response is sent
even in these cases.

Change-Id: I74d7bc6849fde6c734008d67c1f4bc9d9f7a84f9
BUG: 1006367
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5892
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
doc: Steps to recover from split-brain

BUG: 1006776
Change-Id: I6f4bffe992758b2889df9ebfe117834dabe5c1cf
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/4216
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
mgmt/glusterd: Update sub_count on remove brick

Change-Id: I7c17de39da03c6b2764790581e097936da406695
BUG: 1002556
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/5893
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: Add statusStr xml tag to task list and rebalance/remove brick status

New xml tag statusStr added to following gluster cli commands
gluster volume status all --xml (For Task status)
gluster volume rebalance <VOLNAME> status --xml
gluster volume remove-brick <VOLNAME> <BRICK1..> status --xml

Example(volume status all):
<task>
    <type>Rebalance</type>
    <id>82d8d122-8738-4144-8507-d93fc98b61df</id>
    <status>3</status>
    <statusStr>completed</statusStr>
</task>

Example(volume rebalance <VOL> status)
<node>
    <nodeName>localhost</nodeName>
    <files>0</files>
    <size>0</size>
    <lookups>0</lookups>
    <failures>0</failures>
    <status>3</status>
    <statusStr>completed</statusStr>
</node>

Also modified task status as string instead of showing number
in gluster volume status all

Example:
Status of volume: gv1
Gluster process                                         Port    Online  Pid
------------------------------------------------------------------------------
Brick sumne.sumne:/gfs/b1                               49154   Y       15489
Brick sumne.sumne:/gfs/b2                               49155   Y       15493
NFS Server on localhost                                 N/A     N       15913

           Task                                      ID         Status
           ----                                      --         ------
      Rebalance    82d8d122-8738-4144-8507-d93fc98b61df      completed

BUG: 1003521
Change-Id: Ib283016af4c18132fb13fb33d44075782d77823c
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/5739
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
tests/basic/rpm.t: run mock builds inside the current working directory

When running multiple mock builds at the same time, the space
requirements under /var/tmp increases as well. Not all systems (like
build.gluster.org) have enough free space in /var/tmp to host two
mock-roots, which causes building to fail randomly.

Change-Id: Iff1064d01893fb35ef59650d4373105068b5d3f7
BUG: 1006269
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5899
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
qemu-block: fix building from distribution tarball when glib2-devel is installed

Building RPMs from a 'make dist' tarball fails when qemu-block is
enabled. Enabling is done automatically when the glib2 development files
are available (enabled by ./configure).

Manual building with:

  $ ./autogen.sh && ./configure && make dist && rpmbuild -ta *.tar.gz

Building in mock works fine, glib2-devel is not installed by default so
the qemu-block xlator gets disabled. This change also adds glib2-devel
to the BuildRequires in the glusterfs.spec file, causing the qemu-block
xlator to be built by default, and included in the glusterfs RPM.

Change-Id: Ibb73628772586d9e07bbfde7a8ff2fc973489086
BUG: 986775
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5896
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli,glusterd: Task parameters in xml output

This patch introduces task parameters for the asynchronus task shown in
volume status. The parameters are only given for xml output. The
parameters shown currently are,
- source and destination bricks for replace-brick tasks
  ......
        <tasks>
          <task>
            <type>Replace brick</type>
            <id>3d1a1005-9d2e-4ae0-bd62-577bc1d333a3</id>
            <status>1</status>
            <params>
              <srcBrick>archm:/export/test4</srcBrick>
              <dstBrick>archm:/export/test-replace1</dstBrick>
            </params>
          </task>
        </tasks>
  ......
- list of bricks being removed for remove-brick tasks
  ......
        <tasks>
          <task>
            <type>Remove brick</type>
            <id>901c20ca-0da2-41de-8669-5f0caca6b846</id>
            <status>1</status>
            <params>
              <brick>archm:/export/test2</brick>
              <brick>archm:/export/test3</brick>
            </params>
          </task>
        </tasks>
  ......

The changes for non-xml output will be done in a subsequent patch.

Change-Id: I322afe2f83ed8adeddb99f7962c25911204dc204
BUG: 916577
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5771
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
mount/fuse: Implement forget in cbks for fuse.

With the introduction of inode_ctx_set in fuse as part of  2991503d014,
forget cbk gets called for fuse xlator. Though nothing needs to be done
inf forget_cbk, excessive log messages of the following kind are observed:

[2013-09-16 06:09:50.758063] W [defaults.c:1331:default_forget]
(-->/usr/local/lib/glusterfs/3git/xlator/mount/fuse.so(+0xa1f2) [0x7f51432781f2]
(-->/usr/local/lib/libglusterfs.so.0(inode_unref+0x3c) [0x7f5144e5
816c] (-->/usr/local/lib/libglusterfs.so.0(+0x2d061) [0x7f5144e58061]))) 0-fuse:
xlator does not implement forget_cbk

This patch prevents such log messages from being seen.
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
BUG: 979910
Change-Id: Ie5874138f46822b10ff4213bd1134d78330ec460
Reviewed-on: http://review.gluster.org/5932
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Anand Avati <avati@redhat.com>
geo-rep: retry in case of ENOENT errors in entry creations

Change-Id: I8961633a7371c941a3feee44c949d5c934eca998
Original-Author: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 847839
Reviewed-on: http://review.gluster.org/5933
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>