obnox/glusterfs.git
8 years agoglusterd: copy snapshot object during duplication of volfile
Mohammed Rafi KC [Tue, 24 Nov 2015 08:15:20 +0000 (13:45 +0530)]
glusterd: copy snapshot object during duplication of volfile

When creating duplicate volfile for hot/cold tier, we need to
copy the snapshot object in to volfile as it requires to generate
snapshot brick volfile.

Change-Id: I39ccfa20cd1c16ef2801901e3cd3a31c76f8995d
BUG: 1284789
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12734
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
8 years agotier/test: Fixing tests/basic/tier/legacy-many.t
Joseph Fernandes [Wed, 25 Nov 2015 17:22:48 +0000 (22:52 +0530)]
tier/test: Fixing tests/basic/tier/legacy-many.t

Change-Id: Icbd83afdeac053aec5b3b8fa19665a2908e87d8e
BUG: 1285483
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12751
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agotier/ctr: Correcting rename logic
Joseph Fernandes [Fri, 20 Nov 2015 19:34:21 +0000 (01:04 +0530)]
tier/ctr: Correcting rename logic

Problem: When a file with old_file_name and GFID_1 is renamed with a new_file_name
which already exists and with GFID_2, this is what happens in linux internaly.
   a. "new_file_name" is unlinked for GFID_2
   b. a hardlink "new_file_name" is created to GFID_1
   c. "old_file_name" hardlink is unlinked for GFID_2.
Well this is all internal to linux, and gluster just issues a rename system call
at POSIX layer. But CTR Xlator doesn't delete the entries corresponding to the
"new_file_name" and GFID_2. Thus leaving the stale entry in the DB.
The following are the implications.
a. Promotion are tried on these stale entries which will fail and show
false results in the status of migration,
b. GFID_2 Files with 2 hardlinks, which will have only one hardlink
after the rename will not be promoted or demoted as the DB shows 2 entries.

Solution: Delete the older database entry for the replaced hardlink

Change-Id: I4eafa0872253e29ff1f0bec4283bcfc579ecf0e2
BUG: 1284090
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12711
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agoglusterd: Change volume start into v3 framework
Mohammed Rafi KC [Mon, 23 Nov 2015 06:35:54 +0000 (12:05 +0530)]
glusterd: Change volume start into v3 framework

As part of volume start, if the volume is of tier type
then we need to start tiering daemon also. But before
starting tier daemon all the bricks should be started.

So by changing volume start into v3 framework, we can
do tier start in post validate phase

Change-Id: If921067f4739e6b9a3239fc5717696eaf382c22a
BUG: 1284372
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12718
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
8 years agotools/glusterfind: add query command to list files
Milind Changire [Thu, 15 Oct 2015 09:31:23 +0000 (15:01 +0530)]
tools/glusterfind: add query command to list files

When session information is maintained outside Gluster, there needs to
be some mechanism to list files starting from a time-stamp. This patch
implements the feature via the "query" command-line option.

The only caveat is that the first time the query command is run for the
volume, it will likely report that "historical changelogs are not
available". This is due to the fact that changelogs had not been turned
on for the volume so far. So the volume options need to be turned on
outside glusterfind or the since_time need to be greater than the
current time when the query command is run for the very first time for
the volume. The query command turns on the required volume options for
collecting changelogs.

Change-Id: I6cb7a57a5ecd166210e2eb4deede06d40ccfa996
BUG: 1272006
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/12362
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
8 years agofeatures/index : Readdirp performance improvement
Anuradha Talur [Thu, 12 Nov 2015 14:11:33 +0000 (19:41 +0530)]
features/index : Readdirp performance improvement

Things done :
Index now maintains two different directories :
1) for pending xattrs (trusted.afr.volname-client-n,
                       trusted.ec.dirty)

2) for on going xattrs (trusted.afr.dirty)

Based on the xattr, index decides the directory
to add/del entry in/from.

Change-Id: Ie04c02ea2d862cf80426a871a9a1e80b0773d9fd
BUG: 1250803
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/12468
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agoglusterd/bitrot : Integration of bad files from bitd with scrub status command
Gaurav Kumar Garg [Mon, 23 Nov 2015 11:30:07 +0000 (17:00 +0530)]
glusterd/bitrot : Integration of bad files from bitd with scrub status command

Currently scrub status command is not displaying list of all the bad files. All
the bad files are avaliable in the bitd daemon.

With this patch it will dispaly list of all the bad file's in the scrub
status command.

Change-Id: If09babafaf5d7cf158fa79119abbf5b986027748
BUG: 1207627
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/12720
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
8 years agofeatures/shard: Eliminate extra update to postbuf in writev
Krutika Dhananjay [Mon, 23 Nov 2015 07:36:25 +0000 (13:06 +0530)]
features/shard: Eliminate extra update to postbuf in writev

After an extending write is complete, shard translator updates postbuf
at two places:
1. shard_update_file_size_cbk(), and
2. shard_post_update_size_writev_handler().

This can lead to unexpected behavior if md-cache is part of the client
stack and caches and serves values returned by shard translator in
postbuf. This patch eliminates the update to postbuf in
shard_post_update_size_writev_handler().

Change-Id: I9d107bf57baad66886eebec14aa369b6a3c88c49
BUG: 1284365
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/12717
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agoquota: fix backward compatibility of quota xattr version
vmallika [Wed, 18 Nov 2015 11:55:14 +0000 (17:25 +0530)]
quota: fix backward compatibility of quota xattr version

quota-version features is implemented for 3.7.6
please see below patch for more details:
http://review.gluster.org/#/c/12386

Problem is when quota is already enabled,
we suffix 0 to contri xattr key. for backward compatibility
don't add suffix if quota-version is 0

Change-Id: Id7d713b18d989e4e86019969eb511617848127f2
BUG: 1283567
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12660
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agoafr:vol heal info fails when transport.socket.bind-address is set in glusterd
Mohamed Ashiq [Thu, 5 Nov 2015 14:52:02 +0000 (20:22 +0530)]
afr:vol heal info fails when transport.socket.bind-address is set in glusterd

Problem: If glusterd's bind address is specified using transport.socket.bind- address
option to a specific IP, the heal command 'gluster volume heal <VOLNAME> info' fails
with error '<vol_name>: Not able to fetch volfile from glusterd.Volume heal failed.'
This patch uses Unix domain socket transport type of libglfapi to get the volfile.

Change-Id: Ic4239b339f0246d77f1622c07d5f4708129d30c7
BUG: 1277997
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/12508
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agogeo-rep: Fix syntax errors in GsyncdError
Aravinda VK [Tue, 10 Nov 2015 13:16:28 +0000 (18:46 +0530)]
geo-rep: Fix syntax errors in GsyncdError

%s was not replaced by actual values in GsyncdError

BUG: 1279921
Change-Id: I3c0a10f07383ca72844a46f930b4aa3d3c29f568
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/12566
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agomarker : fixing memory leak issue in marker
Manikandan Selvaganesh [Mon, 23 Nov 2015 10:28:42 +0000 (15:58 +0530)]
marker : fixing memory leak issue in marker

In marker_readdirp_cbk, variable resolvedpath is not properly freed
and because of which there was a memory leak. The patch fixes it.

Change-Id: I9d80f72e3551aa912369257da3e8e2b261a2067f
BUG: 1284419
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/12719
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agogeo-rep: Fix Geo-rep logging to log datetime in GMT/UTC
Aravinda VK [Mon, 16 Nov 2015 06:56:00 +0000 (12:26 +0530)]
geo-rep: Fix Geo-rep logging to log datetime in GMT/UTC

Geo-rep is logging in Local time, all other Gluster logs are in
GMT/UTC. It is very difficult to co-relate Geo-rep logs with
other Gluster logs.

BUG: 1282331
Change-Id: Ieae8bda7e4788e587cf4595e21e0e772c210cfbb
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/12583
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agotools/glusterfind: StrictHostKeyChecking=no for ssh/scp verification
Aravinda VK [Mon, 7 Sep 2015 08:48:45 +0000 (14:18 +0530)]
tools/glusterfind: StrictHostKeyChecking=no for ssh/scp verification

Also do not use scp command in case copy file from local
node.

Change-Id: Ie78c77eb0252945867173937391b82001f29c3b0
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1260918
Reviewed-on: http://review.gluster.org/12124
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agocluster/tier: readdirp to cold tier only
Dan Lambright [Wed, 4 Nov 2015 20:33:22 +0000 (15:33 -0500)]
cluster/tier: readdirp to cold tier only

It is possible a file would get migrated in the middle
of a readdir operation. If there are four subvolumes A,B,C,D,
and if readdir reads them in order and reaches subvol B,
then, if a file is moved from D to A, it will not be included
in the readdir output.

This phenonema has pre-existed in DHT migration but is more
apparent in tiering.

When a file is moved off the hashed subvolume a T file is created.
For tiering, we will make the cold subvolume the hashed subvolume.
This will ensure the creation of a T file. Readdir will not skip T
files in the tier translator.

Making the cold subvolume the hashed subvolume ensures the T
files created on promotions or creates will be less likely to
fill the volume.

Creates still put the data on the hot subvolume.

Change-Id: Ifde557d3d0e94a4570ca9f115adee3db2ee75407
BUG:  1281598
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12530
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agofeatures/bit-rot: scrubber changes for getting the list of bad objects from stub
Raghavendra Bhat [Tue, 17 Nov 2015 09:15:30 +0000 (14:45 +0530)]
features/bit-rot: scrubber changes for getting the list of bad objects from stub

Change-Id: I62885e4aba4a9b345db3c78c3291d563ff3d3567
BUG: 1207627
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/12654
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agofeatures/changelog: Capture FXATTROP and XATTROP in changelog
Kotresh HR [Tue, 22 Sep 2015 10:48:29 +0000 (16:18 +0530)]
features/changelog: Capture FXATTROP and XATTROP in changelog

GEO-REP INTEROP WITH SHARD FEATURE

shard xlator updates size of the file using FXATTROP
or XATTROP. Hence record the same in changelog.

Change-Id: Ie0c21e9326da05ea78dc1ef3fd32a90ef38b4bb9
BUG: 1265148
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12225
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agofeatures/bit-rot: stub changes for showing bad objects in the status
Raghavendra Bhat [Mon, 2 Nov 2015 06:13:12 +0000 (11:43 +0530)]
features/bit-rot: stub changes for showing bad objects in the status

Change-Id: If905132f6f1df4aebd9ab255e1e8c59902f84fe5
BUG: 1207627
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/12503
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agoglusterfsd: To support volfile-server-transport type "unix"
Mohamed Ashiq [Mon, 9 Nov 2015 15:13:17 +0000 (20:43 +0530)]
glusterfsd: To support volfile-server-transport type "unix"

glusterfsd fails if the glusterd is bind to specific-IP address.
This patch helps glusterfsd to get the volfile using Unix domain socket.
glusterfs -s <unix socket path> --volfile-server-transport unix
          --volfile-id <volume-name> <mount-point>
The patch checks if the volfile-server-transport is of type "unix",
If It is then uses rpc_transport_unix_options_build to get the volfile.

Change-Id: I81b881e7ac5a3a4f2ac83c789c385cf547f0d53e
BUG: 1279484
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/12556
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agoglusterd: cli command implementation for bitrot scrub status
Gaurav Kumar Garg [Wed, 25 Mar 2015 12:37:24 +0000 (18:07 +0530)]
glusterd: cli command implementation for bitrot scrub status

CLI command  for bitrot scrub status will be :

gluster volume bitrot <volname> scrub status

Above command will show the statistics of bitrot scrubber.

Upon execution of this command it will show some common
scrubber tunable value of volume <VOLNAME> followed by
statistics of scrubber statistics of individual nodes.

sample ouput for single node:

Volume name : <VOLNAME>

State of scrub: Active

Scrub frequency: biweekly

Bitrot error log location: /var/log/glusterfs/bitd.log

Scrubber error log location: /var/log/glusterfs/scrub.log

=========================================================

Node name:

Number of Scrubbed files:

Number of Unsigned files:

Last completed scrub time:

Duration of last scrub:

Error count:

=========================================================

This is just infrastructure. list of bad file, last scrub
time, error count value will be taken care by
http://review.gluster.org/#/c/12503/  and
http://review.gluster.org/#/c/12654/ patches.

Change-Id: I3ed3c7057c9d0c894233f4079a7f185d90c202d1
BUG: 1207627
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/10231
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agoTiering: Adding space between error meassge for detach-tier
hari gowtham [Thu, 19 Nov 2015 06:52:19 +0000 (12:22 +0530)]
Tiering: Adding space between error meassge for detach-tier

Change-Id: I730cf7fa6fbfb3842d337cd3d7b8394b9c3876d8
BUG: 1283488
Signed-off-by: hari gowtham <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/12657
Reviewed-by: mohammed rafi kc <rkavunga@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agocore : Use correct path in dlopen for socket.so
Atin Mukherjee [Thu, 19 Nov 2015 06:30:23 +0000 (12:00 +0530)]
core : Use correct path in dlopen for socket.so

This patch fixes the path for socket.so file while loading the so dynamically.
Also for config.memory-accounting & config.transport voltype is changed to
glusterd to fix the warning message coming from xlator_volopt_dynload

Change-Id: I0f7964814586f2018d4922b23c683f4e1eb3098e
BUG: 1283485
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/12656
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agocluster/ec: Mark internal fops appropriately
Xavier Hernandez [Tue, 17 Nov 2015 13:06:20 +0000 (14:06 +0100)]
cluster/ec: Mark internal fops appropriately

1) Mark read fops in read-modify-write by EC as internal.
2) Handle uid/gid set/reset correctly

BUG: 1282761
Change-Id: I5c1ce0cd6213367eaead5fed33aa2397c4e46df7
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/12599
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agomgmt/gluster: Handle tier brick volgen
Pranith Kumar K [Tue, 17 Nov 2015 08:30:10 +0000 (14:00 +0530)]
mgmt/gluster: Handle tier brick volgen

Index xlator watches only some xattrs based on type of volume. i.e.
disperse/afr. When the volume becomes tiered then index is not adding these
options in the volfile leading to no maintenance of indices. Thus no
proactive self-heals. With this fix, we write brick volfiles considering
the type of volume they belong to.

BUG: 1250803
Change-Id: Ibe8f2d4ad5cb350306ab7ca0753e0f9a40b96a26
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12595
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
8 years agotools/glusterfind: Handle Keyboard interrupt
Aravinda VK [Thu, 16 Jul 2015 11:35:25 +0000 (17:05 +0530)]
tools/glusterfind: Handle Keyboard interrupt

Do not print Python traceback when glusterfind command is interrupted

Change-Id: I67383534f965e410fef7ce09798e9d435ef738ae
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1243812
Reviewed-on: http://review.gluster.org/11698
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agogeo-rep: Fix FD leak from Active Geo-rep worker
Aravinda VK [Sun, 11 Oct 2015 14:56:16 +0000 (20:26 +0530)]
geo-rep: Fix FD leak from Active Geo-rep worker

Active worker tries to acquire lock in each iteration. On every successfull
lock acqusition it was not closing previously opened lock fd.

To see the leak, get the PID of worker,
    ps -ax | grep feedback-fd
    watch ls /proc/$pid/fd

BUG: 1225566
Change-Id: Ic476c24c306e7ab372c5560fbb80ef39f4fb31af
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/12332
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agogeo-rep: Don't log geo-rep safe errors in mount logs
Kotresh HR [Tue, 4 Aug 2015 10:50:13 +0000 (16:20 +0530)]
geo-rep: Don't log geo-rep safe errors in mount logs

ENOENT is a safe error for geo-replication in case of
rm -rf. RMDIR is recorded in changelog of each brick,
geo-rep processes all changelogs among which one will
succeed and rest will get ENOENT which can be ignored.
Similarly ENOENT can also be ignored in case of all
unlink operation during changelog replay that can
happen when worker goes down and comes back.

Change-Id: I6756f8f4c3fce7a159751a2bfce891ff16ad31a4
BUG: 1250009
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/11833
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agoafr: Drop compatibility lock for data self-heal
Ravishankar N [Wed, 18 Nov 2015 03:00:48 +0000 (08:30 +0530)]
afr: Drop compatibility lock for data self-heal

In glusterfs 3.4 and older, AFR did not take locks in self-heal domain
during data self-heal. So this compat lock in data domain was added to prevent
older clients from trying to heal a file while an existing self-heal was going
on by a newer client. But the side effect was that all appending writes (which
take full locks in data domain) from mounts would be stalled until self-heal
was complete.

Since glusterfs 3.4 is not supported anymore, remove the compat lock.

Change-Id: I31c8e4d7f3364f769a14eec295154e3c40d9f78e
BUG: 1283032
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/12602
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agoglusterd/geo-rep: Adding ssh-port option for geo-rep create
Kotresh HR [Mon, 2 Nov 2015 13:22:03 +0000 (18:52 +0530)]
glusterd/geo-rep: Adding ssh-port option for geo-rep create

Geo-replication uses default ssh port 22 for setup.
i.e., to distribute ssh keys to slaves. In container
environments, custom port number might be used.
Hence to support custom port number for ssh, option
is provided in geo-rep create command to take the
same.

Change-Id: I0fb61959b1c085342b8e4c21ac4e076fba5462f1
BUG: 1276028
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12504
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agocluster/tier: Do not delete linkto file on demotion
N Balachandran [Mon, 9 Nov 2015 10:19:50 +0000 (15:49 +0530)]
cluster/tier: Do not delete linkto file on demotion

The current DHT migration code will always delete the
src linkto file after migration as dht always moves
 files to the hashed subvol. This is not the case in tiering.
The lack of linkto files causes rename to fail leaving 2 files
 with the same name but different gfids on the volume.
Modified to leave the linkto file behind if the source
 volume is the hashed subvolume.

Change-Id: I2b99f7d34b4b719aee6232dc40c6a8f8ba88225d
BUG: 1279376
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/12551
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agoglusterd/afr : Readdirp performance improvement
Anuradha Talur [Wed, 21 Oct 2015 11:19:49 +0000 (16:49 +0530)]
glusterd/afr : Readdirp performance improvement

Add xlator options to index xlator with xattrs that
it needs to keep track of.

Change-Id: If818673be5e626f77e65cc3a340f8cdd624179c2
BUG: 1250803
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/12467
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agocluster/ec: Mark self-heal fops as internal
Pranith Kumar K [Tue, 17 Nov 2015 11:31:47 +0000 (17:01 +0530)]
cluster/ec: Mark self-heal fops as internal

Change-Id: I8ae7af266d3e00460f0cfdc9389a926e5f2fee36
BUG: 1282761
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12598
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
8 years agobuild: add libglusterfs/src/defaults.c to .gitignore
Ravishankar N [Wed, 18 Nov 2015 04:01:54 +0000 (09:31 +0530)]
build: add libglusterfs/src/defaults.c to .gitignore

defaults.c is auto-generated since commit
fb2a511493868a9ff0c2926537a4d1d23821ce38. Hence adding it to .gitignore
to stop git from complaining when switching branches.

Change-Id: I586e20f3fe27124c0dc6ba7d151f957d3662a7d0
BUG: 1271325
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/12603
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
8 years agocore: Add experimental xlator directory
Shyam [Thu, 8 Oct 2015 17:59:44 +0000 (13:59 -0400)]
core: Add experimental xlator directory

Added an experimental xlator directory under ./xlators/

The intent of this directory is presented in the README.md
that accompanies this commit.

This directory can be disabled from being compiled using,
  - configure --disable-experimental

Change-Id: I047f380c91a082d111432f8bbdbd4d7bdcbaa809
Signed-off-by: Shyam <srangana@redhat.com>
Reviewed-on: http://review.gluster.org/12321
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agoglusterd.service: Ensure rpcbind is started before glusterd
Kaushal M [Wed, 18 Nov 2015 05:51:13 +0000 (11:21 +0530)]
glusterd.service: Ensure rpcbind is started before glusterd

Having the rpcbind.service under the `After` option only ensures that
glusterd.service is started after rpcbind.service if both are
enabled/started at the same time. It doesn't ensure that starting
glusterd.service will start rpcbind.service.

The systemd.unit(5) man page suggests to use both the `Requires` and
`After` options to ensure that rpcbind is started before glusterd,
whenever glusterd is started.

BUG: 1282915
Change-Id: Iee69965486be08711299aba235f7b00c3e2fe7e9
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/12605
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
8 years agoprotocol/client: prevent use-after-free of frame->root
Niels de Vos [Thu, 12 Nov 2015 08:57:19 +0000 (09:57 +0100)]
protocol/client: prevent use-after-free of frame->root

A regression failure generated a coredump on the glusterfs-client side:

  (gdb) f 0
  #0  0x00007fba6cd76432 in client_submit_request (this=0x7fba68006fc0,
                  req=0x7fba6579aa70, frame=0x7fba5c0058cc,
                  prog=0x7fba6cfb53c0 <clnt3_3_fop_prog>, procnum=41,
                  cbkfn=0x7fba6cd9206d <client3_3_release_cbk>,
                  iobref=0x0, rsphdr=0x0, rsphdr_count=0,
                  rsp_payload=0x0, rsp_payload_count=0, rsp_iobref=0x0,
                  xdrproc=0x7fba79801075 <xdr_gfs3_release_req>) at
  /home/jenkins/root/workspace/rackspace-regression-2GB-triggered/xlators/protocol/client/src/client.c:324
  324                   frame->root->ngrps = ngroups;
  (gdb) l
  319                   gf_msg_debug (this->name, 0, "rpc_clnt_submit failed");
  320           }
  321
  322           if (!conf->send_gids) {
  323                   /* restore previous values */
  324                   frame->root->ngrps = ngroups;
  325                   if (ngroups <= SMALL_GROUP_COUNT)
  326                           frame->root->groups_small[0] = gid;
  327           }
  328
  (gdb) p *frame->root
  Cannot access memory at address 0x64185df000000000

After looking at this in more detail, the flow is like this:

  client_submit_request()
    |
    '- rpc_clnt_submit() // on line 314
         |
         '- cbkfn() // = client3_3_release_cbk
              |
              :- STACK_DESTROY (frame->root);
         .----'
    .----'
    |
    :- frame->root->ngrps = ngroups; // on line 324
    '

So, there is a use-after-free, and it is not needed to restore the
previous groups in frame->root.

Change-Id: I9e7d712183692ed92cfc2f75cd3c2781a9db20e2
BUG: 128128
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/12575
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agolibgfapi: To support set_volfile-server-transport type "unix"
Mohamed Ashiq [Tue, 10 Nov 2015 07:48:41 +0000 (13:18 +0530)]
libgfapi: To support set_volfile-server-transport type "unix"

This patch helps libgfapi to get the volfile using Unix domain socket.
run the attachment file in the bug to test.
The patch checks if the glfs_set_volfile_server transport is of type "unix",
If It is then uses rpc_transport_unix_options_build to get the volfile.

Change-Id: Ifd5d1e7c0d8cc9a906c3c3355b8977141e892a2f
BUG: 1279739
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/12563
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
8 years agogeo-rep: Allow setting config remote_gsyncd
Aravinda VK [Fri, 30 Oct 2015 10:39:29 +0000 (16:09 +0530)]
geo-rep: Allow setting config remote_gsyncd

Restrictive ssh is not used in containerized environment
where networking configuration is "net=host". SSH Pem keys
pushed to the slave without gsyncd path in it. (Patch #12459)

Actual remote_gsyncd path need to be set to actual path of gsyncd.
With this patch, remote_gsyncd is removed from reserved option list.

Change-Id: Ia2063e4654e378b62b2414bdad21143c86ad1b9a
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1276028
Reviewed-on: http://review.gluster.org/12472
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agogeo-rep: New Config option for ssh_port
Aravinda VK [Wed, 28 Oct 2015 12:26:50 +0000 (17:56 +0530)]
geo-rep: New Config option for ssh_port

If different port used for SSH instead of 22, Geo-replication
was failing to establish SSH connection.

ssh_port option can be added using config:ssh_command and
config:ssh_command_tar, but user has to remember complete
ssh command used with parameter to add/modify ssh port.

This patch adds new config option for ssh_port,

gluster volume geo-replication <MASTERVOL> <SLAVEHOST::<SLAVEVOL> \
        config ssh_port 52022

Change-Id: I7753a09485f0b1f49d2b2a80b962c720817c96f4
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1276028
Reviewed-on: http://review.gluster.org/12444
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agotests: spurious failure fix for bug-948686.t
Atin Mukherjee [Fri, 9 Oct 2015 17:01:28 +0000 (22:31 +0530)]
tests: spurious failure fix for bug-948686.t

Ensured import volume and volume start doesn't race in volinfo by refcounting
volinfo.

Change-Id: I7467eccaba9a00fd63ba0121d8157df24d1c00a6
BUG: 1258714
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/12329
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agocore: use syscall wrappers instead of direct syscalls - regression test
Kaleb S. KEITHLEY [Wed, 21 Oct 2015 16:00:03 +0000 (12:00 -0400)]
core: use syscall wrappers instead of direct syscalls - regression test

various xlators and other components are invoking system calls
directly instead of using the libglusterfs/syscall.[ch] wrappers.

If not using the system call wrappers there should be a comment
in the source explaining why the wrapper isn't used.

Change-Id: Id2207deb81a75e1af6f34bf857e74725f8bb532f
BUG: 1267967
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12410
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agocluster/tier make cache mode default for tiered volumes
Dan Lambright [Sat, 14 Nov 2015 19:35:26 +0000 (14:35 -0500)]
cluster/tier make cache mode default for tiered volumes

The default mode for tiered volumes must be cache. The current
test mode was for engineering and should ordinarily not be used
by customers.

Change-Id: I20583f54a9269ce75daade645be18ab8575b0b9b
BUG: 1282076
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12581
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: mohammed rafi kc <rkavunga@redhat.com>
8 years agoquota: fix spurious failure
vmallika [Mon, 9 Nov 2015 06:25:15 +0000 (11:55 +0530)]
quota: fix spurious failure

Change-Id: I5d18533d66df3175752a73430f680dcdfdb3c12a
BUG: 1278689
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12546
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agomarker : handle variable `ret` properly in marker_unlink_cbk
jiffin tony thottan [Mon, 16 Nov 2015 10:21:01 +0000 (15:51 +0530)]
marker : handle variable `ret` properly in marker_unlink_cbk

While compiling new source, the following issue got hit :
marker.c: In function 'marker_unlink_cbk':
marker.c:994:29: warning: variable 'ret' set but not used
         int32_t             ret     = 0;
This patch will fix the same.

Change-Id: I0de60bed3351b3aa1cc80f52d178e447826210e7
BUG: 1257694
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: http://review.gluster.org/12584
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agodht: loc should store proper gfid
Sakshi Bansal [Thu, 12 Nov 2015 08:13:31 +0000 (13:43 +0530)]
dht: loc should store proper gfid

Change-Id: Ic1393d44a9ed4aaba23d7c9ddea45977b9dae5e4
BUG: 1281265
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/12574
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agodht: set proper errno when hashed subvol is not found
Sakshi Bansal [Tue, 10 Nov 2015 04:57:22 +0000 (10:27 +0530)]
dht: set proper errno when hashed subvol is not found

Change-Id: I0c4c72e2f5a9f8a7c60ef65251c596b54de89479
BUG: 1279705
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/12559
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Susant Palai <spalai@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agocore: use syscall wrappers instead of direct syscalls - tail(2)
Kaleb S KEITHLEY [Tue, 17 Nov 2015 00:20:22 +0000 (19:20 -0500)]
core: use syscall wrappers instead of direct syscalls - tail(2)

tail, as in dog chasing its tail. These are the unwrapped
syscalls that have crept in (or were missed) in the previous
patches.

various xlators and other components are invoking system calls
directly instead of using the libglusterfs/syscall.[ch] wrappers.

If not using the system call wrappers there should be a comment
in the source explaining why the wrapper isn't used.

Change-Id: I6015f97109c4250a5a049496a214d19835e4ae19
BUG: 1267967
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12590
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agotier/ctr : MArking ./tests/basic/tier/record-metadata-heat.t as bad
Joseph Fernandes [Tue, 17 Nov 2015 03:08:59 +0000 (08:38 +0530)]
tier/ctr : MArking ./tests/basic/tier/record-metadata-heat.t as bad

./tests/basic/tier/record-metadata-heat.t as bad

Change-Id: I92e1f9f3103e557e99af627d25700946fcb0b7a7
BUG: 1282673
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12591
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agocore: use syscall wrappers instead of direct syscalls - tail
Kaleb S KEITHLEY [Mon, 16 Nov 2015 15:54:01 +0000 (10:54 -0500)]
core: use syscall wrappers instead of direct syscalls - tail

tail, as in dog chasing its tail. These are the unwrapped
syscalls that have crept in (or were missed) in the previous
patches.

various xlators and other components are invoking system calls
directly instead of using the libglusterfs/syscall.[ch] wrappers.

If not using the system call wrappers there should be a comment
in the source explaining why the wrapper isn't used.

Change-Id: If183487de92fc7cbc47d4c5aa3f3e80eae50b84f
BUG: 1267967
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12589
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agobuild: fix ecdh.h and dh.h deps
Milind Changire [Thu, 5 Nov 2015 14:27:51 +0000 (19:57 +0530)]
build: fix ecdh.h and dh.h deps

openssl.ecdh.h and openssl/dh.h are not available on all platforms.
This patch adds check to autoconf and updates relevant source files.
Add missing #include "config.h" to socket.c to make HAVE_OPENSSL_DH_H
and HAVE_OPENSSL_ECDH_H macros available.

Definitions for UTIME_OMIT and UTIME_NOW in
contrib/qemu/util/oslib-posix.c have been selected from
/usr/include/bits/stat.h on Fedora 22

SSL context options SSL_OP_NO_TICKET and SSL_OP_NO_COMPRESSION are now
conditionally set by testing their presence.

glusterfs.spec.in file now adds CFLAGS=-DUSE_INSECURE_OPENSSL for
RHEL < 6 in the %build section.

Change-Id: Ie32a950dad77bb0f09b4ba53edb3e1f3147056f3
BUG: 1258883
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/12517
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agocore: use syscall wrappers instead of direct syscalls - libglusterfs
Kaleb S. KEITHLEY [Thu, 1 Oct 2015 20:28:58 +0000 (16:28 -0400)]
core: use syscall wrappers instead of direct syscalls - libglusterfs

various xlators and other components are invoking system calls
directly instead of using the libglusterfs/syscall.[ch] wrappers.

If not using the system call wrappers there should be a comment
in the source explaining why the wrapper isn't used.

Change-Id: Ieeca2d36adbc884e4cfa0026dba40df70310d40b
BUG: 1267967
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12275
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agoafr: replica pair going offline does not require CHILD_MODIFIED event
Sakshi Bansal [Thu, 12 Nov 2015 06:58:53 +0000 (12:28 +0530)]
afr: replica pair going offline does not require CHILD_MODIFIED event

As a part of CHILD_MODIFIED event DHT forgets the current layout and
performs fresh lookup. However this is not required when a replica pair
goes offline as the xattrs can be read from other replica pairs. Hence
setting different event to handle replica pair going down.

Change-Id: I5ede2a6398e63f34f89f9d3c9bc30598974402e3
BUG: 1281230
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/12573
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Susant Palai <spalai@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agoextras/hooks: Fix parsing of args in S30samba-set.sh
Raghavendra Talur [Tue, 14 Jul 2015 17:54:55 +0000 (23:24 +0530)]
extras/hooks: Fix parsing of args in S30samba-set.sh

Change-Id: I75756f44757a144b0ed229fcc0e29a273fc75886
BUG: 1242892
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/11668
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agocluster/tier: Disallow detach commit when detach in progress
Dan Lambright [Thu, 1 Oct 2015 15:05:25 +0000 (11:05 -0400)]
cluster/tier: Disallow detach commit when detach in progress

1. Check if detach is running, disallow detach commit if so.
2. Cleanup shutdown of tier daemon on detach: do not rerun fix-layout,
   do not send incorrect status back to glusterd.

Change-Id: I97202f748773c1176396a4ffd32a4c7fa9b9c1bc
BUG: 1279637
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12560
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
8 years agoglusterd: brick failed to start
Mohammed Rafi KC [Mon, 9 Nov 2015 11:13:21 +0000 (16:43 +0530)]
glusterd: brick failed to start

brick volfiles are generated in post validate, if
it is running version higher than GLUSTER_3_7_5,
else will be running in syncop.

If the code fall back to syncop, and volume is stopped
then we were returning the operation with out generating
volfiles.

Change-Id: I3b16ee29de19c5d34e45d77d6b7e4b665c2a4653
BUG: 1282322
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12552
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
8 years agobuild: install and package header files more conventionally
Kaleb S. KEITHLEY [Wed, 14 Oct 2015 15:13:50 +0000 (11:13 -0400)]
build: install and package header files more conventionally

The current way we install and package header files for the -devel
package is a hack. This patch uses more conventional autoconf, libtool,
and rpmbuild idioms to package -devel headers and libraries.

Change-Id: I63ffb3460f5c12b6b355493bd00824ac9e5354c5
BUG: 1271907
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12360
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agopackaging: gfind_missing_files not in geo-rep %if ... %endif conditional
Kaleb S KEITHLEY [Fri, 13 Nov 2015 17:55:17 +0000 (12:55 -0500)]
packaging: gfind_missing_files not in geo-rep %if ... %endif conditional

if geo-rep is disabled in the build then the gfind_missing_files
are erroneously included in the ganesha sub-package

Change-Id: I440df7e8283bcc8a80aa057c1c9d6f8034ca98d2
BUG: 1281892
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12577
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agocluster/afr : Remove stale indices
Ashish Pandey [Mon, 12 Oct 2015 07:44:08 +0000 (13:14 +0530)]
cluster/afr : Remove stale indices

Change-Id: Iba23338a452b49dc9fe6ae7b4ca108ebc377fe42
BUG: 1270668
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/12336
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
8 years agotier/ctr: Providing option to record or ignore metadata heat
Joseph Fernandes [Sun, 8 Nov 2015 10:03:15 +0000 (15:33 +0530)]
tier/ctr: Providing option to record or ignore metadata heat

Currently we heat up a file for both data and metadata write.
Here we provide a ctr xlator option called "ctr-record-metadata-heat"
were the admin can decide on recording metadata heat i.e heatup a
file on metadata writes or not.
Metadata data operation are
a. setattr: explicit changing of atime/mtime using utimes,
            changing of posix permissions of the file
b. rename: Renaming a file,
c. unlink, link: adding or deleting hardlinks
d. xattrs: setting or removal of xattrs.

NOTE: atime, mtime and ctime change through writev, readv, truncate, mknod
and create will not be considered here as these fops are data and primary
metadata fops.

Defaultly "ctr-record-metadata-heat" is off. Admin can
switch it on using gluster volume set command.

Change-Id: I91157509255dd5cb429cda2b6d4f64582e155e7b
BUG: 1279166
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12540
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agodocs: move contributor docs to the glusterdocs repository
Bipin Kunal [Fri, 13 Nov 2015 13:49:17 +0000 (19:19 +0530)]
docs: move contributor docs to the glusterdocs repository

 *  Moved few files to glusterdocs repo
 *  Files were moved in pull requests given below:
    https://github.com/gluster/glusterdocs/pull/60
    https://github.com/gluster/glusterdocs/pull/62
 * This patch removes file from this repo which were
   moved to glusterdocs repo

Change-Id: I6e529911e0be66b261961c44bcdbe361aafa2886
BUG: 1206539
Signed-off-by: Bipin Kunal <bkunal@redhat.com>
Reviewed-on: http://review.gluster.org/12576
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agobuild: `make distclean` doesn't clean all it ought to, needs to
Kaleb S KEITHLEY [Fri, 13 Nov 2015 19:07:03 +0000 (14:07 -0500)]
build: `make distclean` doesn't clean all it ought to, needs to

Debian builds fail to "build twice in a row" due to left over files
remaining after running `make distclean`

The main culprits are files created from *.in files during ./configure.
In particular these are ./glusterfs-api.pc, ./libgfchangelog.pc,
./libgfdb.pc, and ./tests/env.rc.

The strange one is contrib/umountd/Makefile{,.in}. While these are
created by ./configure - for reasons I don't quite fathom, perhaps
because contrib/umountd is included in EXTRA_DIST - after that
make and make distclean don't descend into the directory to build or
clean it (because it's not needed for Linux, and not built.)

Also removing the `find . -name Makefile -exec rm -f {}\;` from the
gitclean target, it's not needed (redundant) as its prereq distclean
target will have already removed them.

Change-Id: Ifc45b71d852052ef4b92f356279ce2ba2bbc5bb6
BUG: 1279836
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Tested-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agotests: fix spurious error in fops-during-migration-pause.t
Dan Lambright [Wed, 11 Nov 2015 20:54:10 +0000 (15:54 -0500)]
tests: fix spurious error in fops-during-migration-pause.t

The test did not spend long enough time moving the file for the
pause to occur simultaneously, leading to failure. Solution is
to elongate that time by increasing the file size.

Change-Id: I1727fa9e3f7a987dfa07dd5da44c68d3f17218d9
BUG: 1280428
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12570
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
8 years agotier/libgfdb: Extending log level flexibity in libgfdb
Joseph Fernandes [Tue, 10 Nov 2015 17:20:55 +0000 (22:50 +0530)]
tier/libgfdb: Extending log level flexibity in libgfdb

Extending log level flexibity to relevant fops and operations
This is an extension to
http://review.gluster.org/#/c/12491/

Change-Id: I33b2f7732f89f52569fb99baa692c7e3bb4c7ab1
BUG: 1277352
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12567
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agocluster/ec: fix bug in update_good
Pranith Kumar K [Tue, 10 Nov 2015 03:36:54 +0000 (09:06 +0530)]
cluster/ec: fix bug in update_good

Problem:
Bricks that didn't participate in the fops are considered to be good. This is happening two fold.
Examples:
Case-1:
1) 2+1 volume. 'd1' directory on Brick-0 is bad.
2) readdir takes locks and lock->good_mask is '7'
3) readdir does xattrop and fop->mask is '6'.
4) because fop->expected is '1' lock->good_mask remains '7'

Case-2:
1) when all the bricks are up, it does lock + xattrop before op and figures out
   all the bricks are good.
2) By the time second operation starts brick-0 is down. Now lock->good_mask
   will always have the '0' bit set as long as the operations are happening on it.
   because: "lock->good_mask &= ~fop->mask | fop->remaining" fop->mask doesn't
   have '0' th bit.
3) When it comes time to perform the final xattrop in update_size_version
   brick-0 comes online because of which it gives the same version to brick-0
   as well thinking it has participated in all the transactions till then, even
   when it didn't participate in the transactions.

Fix:
Case-1's fix: Update lock->good_mask in ec_prepare_update_cbk with latest
good/bad bricks
Case-2's fix: Consider non-participating brick as bad.

Change-Id: Ic01a733f8180131ded6a3cc784fcb1960758cf23
BUG: 1276989
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12561
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
8 years agotier/ctr: ignoring bitrot scrubber fops
Joseph Fernandes [Mon, 9 Nov 2015 15:06:11 +0000 (20:36 +0530)]
tier/ctr: ignoring bitrot scrubber fops

We had missed adding  GF_CLIENT_PID_SCRUB to the internal fops
list of bitrot. Doing that in this fix

Change-Id: I0c7de37e2bf625fb577a32a599a885ee95f5d3bd
BUG: 1278326
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12555
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agoRemove selinux mount option from "man mount.glusterfs"
hari gowtham [Mon, 26 Oct 2015 06:37:16 +0000 (12:07 +0530)]
Remove selinux mount option from "man mount.glusterfs"

Gluster doesn't SELinux mount option, so it is removed.

Change-Id: I471ad98a24b5f5d64279c805b3243cb1168dd3d1
BUG: 1274626
Signed-off-by: hari gowtham <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/12422
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agobuild: Remove systemtap references from source
Anoop C S [Tue, 10 Nov 2015 10:50:27 +0000 (16:20 +0530)]
build: Remove systemtap references from source

We don't actually support systemtap. And so it is confusing
to have --enable-systemtap configure option in configure.ac.
This patch removes the systemtap option and corresponding
references from other files which include INSTALL, spec.in,
docs etc.

Change-Id: I719c22ca36f41a2faca156f8e41daea44e64b65e
BUG: 1198849
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-on: http://review.gluster.org/12565
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agofeatures/gfid-access: Fix entry creation via setxattr for geo-rep
Kotresh HR [Tue, 15 Sep 2015 11:26:01 +0000 (16:56 +0530)]
features/gfid-access: Fix entry creation via setxattr for geo-rep

GEO-REP INTEROP WITH SHARD FEATURE

Problem:
    Geo-replication uses setxattr interface of gfid-access
    xlator to create entries and send explicit setattr
    after entry creation to set uid and gid. But between
    entry creation and setattr, the inode would not be
    linked. Hence operation which accesses inode structure
    during setattr by any the below xlator fails.

Solution:
    Linking inode would seem the obvious solution but,
    gfid-access xlator cannot link inodes and maintain
    it as it would result in same inode pointing
    to two different paths one being virtual .gfid/<gfid>
    path and other being actual path.

    The solution is to set uid and gid in frame->root->uid
    and frame->root->gid respectively from which posix
    extracts and sets.

Change-Id: Ic0749ee471432caeb8ded3152a07de6e64d8538d
BUG: 1265148
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12206
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
8 years agobuild: MKDIR_P is not defined for Makefiles, use mkdir_p instead
Niels de Vos [Mon, 9 Nov 2015 12:04:03 +0000 (13:04 +0100)]
build: MKDIR_P is not defined for Makefiles, use mkdir_p instead

Change-Id: Id6d5263eb7b1c53e72a7668e716e9cc4e34b82cd
Reported-by: Milind Changire <mchangir@redhat.com>
BUG: 1198849
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/12553
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agoextras: Exit with SUCCESS if no processes to stop
Shubhendu Tripathi [Wed, 22 Jul 2015 11:25:06 +0000 (16:55 +0530)]
extras: Exit with SUCCESS if no processes to stop

This script might be executed even when there are no
valid processes running to be stopped. In this scenario,
the script should return with SUCCESS

Change-Id: Ia293214a4b5052bc4bef9769f197f7b05c55ffe9
BUG: 1277533
Signed-off-by: Shubhendu Tripathi <shtripat@redhat.com>
Reviewed-on: http://review.gluster.org/11739
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agotests: make mount-nfs-auth.t more stable
Niels de Vos [Fri, 6 Nov 2015 16:39:38 +0000 (17:39 +0100)]
tests: make mount-nfs-auth.t more stable

mount-nfs-auth.t has a funky way of restarting the Gluster/NFS service.
It is a little racy and does not always work. Disabling and enabling the
nfs.disable volume option triggers a restart of the Gluster/NFS service
too, and is much simpler.

Also adding a little more EXPECT_WITHIN statements to prevent the
occasional failures.

Change-Id: I6765e9f021abbe995dfac00fbfc67298e2ec769c
BUG: 1278476
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/12542
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agosnapshot: Remove bug-1275616.t from bad tests
N Balachandran [Mon, 9 Nov 2015 04:49:25 +0000 (10:19 +0530)]
snapshot: Remove bug-1275616.t from bad tests

Remove bug-1275616.t from bad tests list as
commit 466f56a91265ac928759642a866bdc27e850654f
has fixed the spurious failure.

Change-Id: I0d3d86e4e98e3ca810692835ca0a7f119b759620
BUG: 1279297
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/12544
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agogeo-rep: Make restrictive ssh keys optional
Kotresh HR [Thu, 29 Oct 2015 09:30:15 +0000 (09:30 +0000)]
geo-rep: Make restrictive ssh keys optional

In containerized environment where networking
configuration is "net=host", both host and
containers use the same IP. The validations
gsyncd shell and rsync to be the siblings
fails. Hence, for now, creating restrictive
ssh keys is made optional as follows.

If the argument 'container' is passed, it
will create non restrictive ssh keys else
restrictive ssh keys.

e.g.,
gluster system:: execute gsec_create container
     Creates non restrictive ssh keys.
gluster system:: execute gsec_create
     Creates restrictive ssh keys.

Change-Id: Ibed362f64b9b4c9931207f863a2da944c6bd1d66
BUG: 1276028
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12459
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
8 years agomarker: do remove xattr only for last link
vmallika [Mon, 2 Nov 2015 10:09:46 +0000 (15:39 +0530)]
marker: do remove xattr only for last link

With unlink, rename, rmdir, contribution xattrs
are removed. If the file is a last link
then remove_xattr will fail with ENOENT.

So it better to perform remove_xattr
only if there are more links to the file

Change-Id: Ifc1e7fda4d310fd87f6f28a635c9ea78b8f3929d
BUG: 1257694
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12033
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agomd-cache: Remove readdirp fop for md-cache
Mohammed Rafi KC [Wed, 12 Aug 2015 09:26:27 +0000 (14:56 +0530)]
md-cache: Remove readdirp fop for md-cache

readdirp call will return inode for each entry and
will share this nodeid with kernal, also md-cache
will cache this gfid and base name. So when a lookup
operation is perfromed on such an inode, md-cache
will wind the call, that prevents populating inode
ctx for other lower layer xlators.

Change-Id: I43c768703a3cc66d05b1c32909d1a2781001cb49
BUG: 1236032
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11894
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agogfapi: function exit should use __GLFS_EXIT_FS
Milind Changire [Thu, 29 Oct 2015 15:09:57 +0000 (20:39 +0530)]
gfapi: function exit should use __GLFS_EXIT_FS

glfs api functions must be using __GLFS_EXIT_FS to exit from functions

Change-Id: If6b71d8182f3dffe15a3606f31798904cb67be1b
BUG: 1263056
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/12462
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
8 years agogeo-rep: Kill Geo-rep Worker when Agent process dies
Aravinda VK [Fri, 30 Oct 2015 11:36:58 +0000 (17:06 +0530)]
geo-rep: Kill Geo-rep Worker when Agent process dies

When Changelog agent process dies, Geo-replication fails to detect
and worker will run without respective Changelog agent. Status shows
Active/Passive without any progress.

With this patch, Worker process gets killed whenever Changelog
agent dies.

Change-Id: I30b4cc77f924f7e8174b8bfe415ac17f0b3851b4
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1277076
Reviewed-on: http://review.gluster.org/12485
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
8 years agobuild: Fix autoconf warnings
Anoop C S [Wed, 14 Oct 2015 07:41:37 +0000 (13:11 +0530)]
build: Fix autoconf warnings

This patch avoids the following warnings on running autogen script

. . .
Running autoconf...
configure.ac:896: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in
body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
configure.ac:896: the top level
. . .

This change uses AC_LINK_IFELSE for checking the atomic built-in function
support. Since AC_COMPILE_IFELSE checks for syntactical errors only, we need
to use AC_LINK_IFELSE to achieve the same which is more appropriate.

Reference links:
[1] https://autotools.io/forwardporting/autoconf.html
[2] http://www.gnu.org/software/autoconf/manual/autoconf.html#Generating-Sources
[3] http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-the-Compiler

Change-Id: I4597f2976623496745b66f98bb78a0c9f1b07f79
BUG: 1198849
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-on: http://review.gluster.org/12351
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
8 years agodht: heal directory path if the directory is not present
Mohammed Rafi KC [Thu, 15 Oct 2015 06:31:14 +0000 (12:01 +0530)]
dht: heal directory path if the directory is not present

After a successful nameless lookup if the directory is not
present on any of the subvol, then we will get the path of
the directory and will recursively send a named lookp on
each parent directory.

This will help particularly for the scenarios like add brick
and attach-tier.

Change-Id: I64c2118a5ab03bbaa59b0dfc62babdf4472a92a3
BUG: 1272949
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12376
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agodht: update cached subvolume during readdirp cbk
Mohammed Rafi KC [Wed, 28 Oct 2015 17:40:00 +0000 (23:10 +0530)]
dht: update cached subvolume during readdirp cbk

This reverts commit bb2370514598a99e6ab268af81df57dc16caa2c5.

issue and impact: readdirp_cbk was not resetting the layout for files,
this causes problem if the files is moved from one cached subvolume
and if the layout was not proper, then there is chance to fail
entry fops if the fops executed with out a lookup. Because the
cached subvolume will not change and the application assumes the
presence of file in cached subvol. so it fails with ENOENT.

The patch preset the layout information in readdirp cbk
for each files in the entry. That leaves the problem the commit
bb2370514598a99e6ab268af81df57dc16caa2c5 try to fix. We will fix the
problem in a separate patch.

Change-Id: I878ec32f44edde2fb9d4f132d9b1b547cde993d9
BUG: 1272949
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12449
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agogeo-rep: Fix syncing chown in xsync crawl
Kotresh HR [Mon, 21 Sep 2015 09:21:13 +0000 (14:51 +0530)]
geo-rep: Fix syncing chown in xsync crawl

GEO-REP INTEROP WITH SHARD FEATURE

Problem:
    The sequence of entry creation and chown in master
 is recorded as creation of entry with resulted
 user:group in xsync changelog. During sync, entry
 creation is always split into two ops, MKNOD and
 SETATTR. Hence the issue is not being hit otherwise
 it would have failed with EPERM if parent is owned
 by different user. But with shard translator being
 enabled on slave, doing entry creation with MKNOD and
 SETATTR is not allowed, SETATTR fails as it accesses
 inode structure which is not linked.

Solution:
    The sequence of entry creation and chown in master
 should be recorded as MKNOD and SETATTR separately always
 and do entry creation with single op in gfid-access
 xlator. The gfid-access patch will be sent separately.

Change-Id: I93e554bf9342397a7660503f5128e9709f8a0cd8
BUG: 1265148
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12205
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
8 years agoRevert "fuse: resolve complete path after a graph switch"
Mohammed Rafi KC [Thu, 15 Oct 2015 14:10:55 +0000 (19:40 +0530)]
Revert "fuse: resolve complete path after a graph switch"

This reverts commit d0edb6d555d687f76837515207b9408be0bdd55e.
The same functionality will be provided in a different patch

Change-Id: I3139478b218fa32e803bb088df585fbbdf94af34
BUG: 1272949
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12375
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
8 years agocluster/tier correct promotion cycle calculation
Dan Lambright [Sun, 1 Nov 2015 15:22:00 +0000 (10:22 -0500)]
cluster/tier correct promotion cycle calculation

The tier translator should only choose candidate files for promotion
from the most recent cycle, not a multiple of the most recent cycles.
Otherwise user observed behavior can be inconsistent. Remove related
test in tier.t that is subject to race condition.

Change-Id: I9ad1523cac00f904097ce468efa6ddd515857024
BUG: 1275524
Signed-off-by: root <root@rhs-cli-15.gdev.lab.eng.bos.redhat.com>
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12480
Reviewed-by: Joseph Fernandes
Tested-by: Gluster Build System <jenkins@build.gluster.com>
8 years agotiering:Message shown in gluster vol tier <volname> status output is incorrect
Mohamed Ashiq [Fri, 6 Nov 2015 18:49:48 +0000 (00:19 +0530)]
tiering:Message shown in gluster vol tier <volname> status output is incorrect

Change-Id: I15a1a637090f1cc2f200d5c3582317e4aa3cf334
BUG: 1278927
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Reviewed-on: http://review.gluster.org/12532
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agotier/ctr: Ignore CTR Lookup heal insert errors
Joseph Fernandes [Tue, 3 Nov 2015 06:38:16 +0000 (12:08 +0530)]
tier/ctr: Ignore CTR Lookup heal insert errors

CTR doesnt read from the DB, so to make sure that file records are
created it does a heal during a lookup. It remembers the decision in
the inode context cache and retrys periodically. When the volume is
restarted it looses all the inode cache from the previous time and CTR
lookup heals tries the heal again, but this time it finds that the records
are already there from sql and logs this error, and remembers this until the
volume is restarted or inode is flushed out of inode cache of the brick.

Solution: the log levels should be reduced to trace for this case and
customers need not see this.

Change-Id: I67b568fb6904f8597e2c6d32894a247c4f500b94
BUG: 1277352
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12491
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agosnapshot: Add bug-1275616.t to bad test list
N Balachandran [Fri, 6 Nov 2015 08:53:07 +0000 (14:23 +0530)]
snapshot: Add bug-1275616.t to bad test list

bug-1275616.t fails spuriously in regression tests

Change-Id: Iea01476a9ffd811091865196e1536361d2298ab7
BUG: 1278418
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/12527
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agoquota: fix for spurious failure
vmallika [Fri, 6 Nov 2015 07:47:26 +0000 (13:17 +0530)]
quota: fix for spurious failure

Filed a bug# 1278689.
For now marking the testcase tests/bugs/quota/bug-1235182.t' bad
once the bug# 1278689, remove the testcase from bad list

Change-Id: I224f907153d3e5f35834007a40b0050246d8787a
BUG: 1278689
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12526
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agotier/libgfdb: Replacing ASCII query file with binary
Joseph Fernandes [Tue, 13 Oct 2015 18:30:41 +0000 (00:00 +0530)]
tier/libgfdb: Replacing ASCII query file with binary

Earlier, when the database was queried we used to save
all the queried records in an ASCII format in the query file.
This caused issues like filename having ASCII delimiter and used
to take a lot of space. The tier.c file also had a lot of parsing code.

Here we changed the format of the query file to binary.
All the logic of serialization and formating of query record is done
by libgfdb. Libgfdb provides API,
gfdb_write_query_record() and gfdb_read_query_record(),
which the user i.e tier migrator and CTR xlator can use to
write to and read from query file.
With this binary format we save on disk space i.e reduce to 50% atleast
as we are saving GFID's in binary format 16 bytes and not the string format
which takes 36 bytes + We are not saving path of the file + we are also saving on
ASCII delimiters.

The on disk format of query record is as follows,

+---------------------------------------------------------------------------+
| Length of serialized query record |       Serialized Query Record         |
+---------------------------------------------------------------------------+
             4 bytes                     Length of serialized query record
                                                      |
                                                      |
     -------------------------------------------------|
     |
     |
     V
   Serialized Query Record Format:
   +---------------------------------------------------------------------------+
   | GFID |  Link count   |  <LINK INFO>  |.....                      | FOOTER |
   +---------------------------------------------------------------------------+
     16 B        4 B         Link Length                                  4 B
                                |                                          |
                                |                                          |
   -----------------------------|                                          |
   |                                                                       |
   |                                                                       |
   V                                                                       |
   Each <Link Info> will be serialized as                                  |
   +-----------------------------------------------+                       |
   | PGID | BASE_NAME_LENGTH |      BASE_NAME      |                       |
   +-----------------------------------------------+                       |
     16 B       4 B             BASE_NAME_LENGTH                           |
                                                                           |
                                                                           |
   ------------------------------------------------------------------------|
   |
   |
   V
   FOOTER is a magic number 0xBAADF00D indicating the end of the record.
   This also serves as a serialized schema validator.

Change-Id: I9db7416fd421e118dd44eafab8b535caafe50d5a
BUG: 1272207
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12354
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agotests/tier : Corrected filename in run-tests.sh
N Balachandran [Fri, 6 Nov 2015 09:06:37 +0000 (14:36 +0530)]
tests/tier : Corrected filename in run-tests.sh

bug-1214222-directories_miising_after_attach_tier.t
was renamed to bug-1214222-directories_missing_after_attach_tier.t
 but run-tests.sh was not updated.

Change-Id: I64d6475ffb08e3252e56b4083cb0e828ba3584d9
BUG: 1278709
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/12528
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agosnapshot: Making bug-1275616.t more regression failure tolerant
Avra Sengupta [Thu, 5 Nov 2015 12:49:14 +0000 (18:19 +0530)]
snapshot: Making bug-1275616.t more regression failure tolerant

snapshot clone creation fails 'spuriously' on the
regression setup coz the brick rpc connect for snap3
in the testcase, happens way after the snap was created.

So adding a EXPECT_WITHIN $PROCESS_UP_TIMEOUT check(read delay)
to help the cause. But this isn't a 100% guaranteed fix, as on an
even slower machine, even this check will fail followed by the
subsequent failures that this patch is trying to fix in the first place

Change-Id: I2f31558b717fd610111f14e451fe444c09f3f254
BUG: 1278418
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/12516
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: mohammed rafi kc <rkavunga@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
8 years agocluster/tier: fix lookup-unhashed on tiered volumes
Dan Lambright [Tue, 3 Nov 2015 23:27:18 +0000 (18:27 -0500)]
cluster/tier: fix lookup-unhashed on tiered volumes

During attach tier the commit hash must be copied to the hot tier.

Change-Id: I91b92fd8e98696993433856e1436409b657c439d
BUG: 1277716
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12498
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agotier/ctr: Ignore bitrot related fops
Joseph Fernandes [Thu, 5 Nov 2015 09:29:54 +0000 (14:59 +0530)]
tier/ctr: Ignore bitrot related fops

Ignore bitrot related fops since they are internal fops.

Change-Id: I5db8cf4e3fa1b186a6987eed54287bc0e964fbd4
BUG: 1278326
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12512
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agoxlators/nfs add mount-nfs-auth.t to ignored tests list
Dan Lambright [Thu, 5 Nov 2015 15:04:42 +0000 (10:04 -0500)]
xlators/nfs add mount-nfs-auth.t to ignored tests list

mount-nfs-auth.t fails spuriously in regression. After discussion with
NFS leads agree to put it into ignored list until the problem is solved.

Change-Id: I44efc3332409ef963819f31d1775138d8a04a0f9
BUG: 1278476
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/12521
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agocluster/ec: Fix bad management of lock owners
Xavier Hernandez [Wed, 28 Oct 2015 13:00:41 +0000 (14:00 +0100)]
cluster/ec: Fix bad management of lock owners

Since the addition of parallel reads patch for ec, a lock can have
more than one owner at the same time. The list of owners was stored
inside the 'owner_list' field of each fop.

The problem was with fops that required more than one lock (like
rename). In this case the same field was used to add the fop to
more than one list, casing an overwrite of the previous list.

This has been solved moving the 'owner_list' field from ec_fop_data_t
to ec_lock_link_t structure.

Change-Id: I6042129f09082497b80782b5704a52c35c78f44d
BUG: 1276031
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/12445
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agomgmt/glusterd: Store arbiter-count and restore it
Pranith Kumar K [Fri, 30 Oct 2015 10:26:14 +0000 (15:56 +0530)]
mgmt/glusterd: Store arbiter-count and restore it

Problem:
1) Glusterd doesn't remember about arbiter information of replica volume in
   store.  When glusterd goes down and comes backup, arbiter volumes will
   become replica volumes.

2) Glusterd doesn't import/export arbiter information to/from the other peers.

3) Volume info doesn't show any arbiter count in the output.

Fix:
1) Persist arbiter information in glusterd-store
2) Import/Export arbiter information of the volume
3) Change volume info output to show arbiter count.

Change-Id: I2db81e73d2694b01f7d07b08a17b41ad5a55c361
BUG: 1276675
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12475
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agotier/dht: Ignoring replica for migration counting
Joseph Fernandes [Thu, 29 Oct 2015 06:36:57 +0000 (12:06 +0530)]
tier/dht: Ignoring replica for migration counting

We used to count replica files for migration counting even though
they were ignore for migration as the replica brick didnt have
the ownership (as per the replication xlator either AFR/EC).
As a result the number of files migrated would show a wrong count,
i.e each replicated file would be counted 1 + number of replica.

This patch ignores such cases.

Change-Id: I91aa352ee3b0a5029790653266e9333f3947d0ac
BUG: 1276141
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/12453
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agov info for disperse count fails while upgrading
Hari Gowtham [Tue, 3 Nov 2015 12:53:56 +0000 (18:23 +0530)]
v info for disperse count fails while upgrading

The upgrade from 3.7.5-3 to 3.7.5-5 causes the type and number
of bricks for the cold tier to be printed wrong.

Change-Id: Ia45b97c35fef88f9c66e15e5bdb93fd30cb342af
BUG: 1277481
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/12495
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
8 years agogeo-rep: Update last_synced_time in XSync
Aravinda VK [Tue, 28 Jul 2015 09:22:00 +0000 (14:52 +0530)]
geo-rep: Update last_synced_time in XSync

During XSync crawl, last_synced time in status file was not updated.
This patch fixes the issue by updating status file when stime xattr
is updated after Xsync or Changelog Crawl.

Change-Id: I4dc3a2d4c3d8378a939da0868caf1aef4f789599
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1247536
Reviewed-on: http://review.gluster.org/11771
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
8 years agoglusterd: move new feature (tiering) enum op to the last of the array
Gaurav Kumar Garg [Fri, 30 Oct 2015 11:09:16 +0000 (16:39 +0530)]
glusterd: move new feature (tiering) enum op to the last of the array

Currently new feature tiering have GD_OP_DETACH_TIER and GD_OP_TIER_MIGRATE
enum in the middle of the glusterd_op_ enum array. In multi nodes
cluster when one of the node upgraded from lower version to higher
version and upon executing command can end up in a mismatch in enum ops
at the receiver ends causing command execution fail.

Fix is to put every new feature glusterd operation enum code to last of
the enum array.

Change-Id: I640f811065e8c84add624237aa80fed43fde5967
BUG: 1276643
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/12473
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
8 years agocorrection of message displayed after attach tier
hari gowtham [Mon, 2 Nov 2015 09:51:19 +0000 (15:21 +0530)]
correction of message displayed after attach tier

the message after attach tier is saying rebalance.
It is changed according to tiering.

Change-Id: I1834511f86483fa60f404d7defe5be59c025e9d6
BUG: 1277081
Signed-off-by: hari gowtham <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/12488
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>