6843 Commits

Author SHA1 Message Date
Humble Chirammal
e232b4c674 mention use-readdirp option in mount section
Change-Id: I843a8b7713f96dcb5fdb07b8cadc47b4adc0a7b9
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/7939
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-17 04:38:27 -07:00
Amar Tumballi
d65e8a871a extras: add a script to stop all the glusterfs process
Change-Id: I9f73bf0308625695ed78db06478963d16644852a
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.org/6270
Reviewed-by: Sachidananda Urs <sacchi@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-17 04:37:21 -07:00
Raghavendra Bhat
53d932b490 mgmt/glusterd: save the snapd port in volinfo after starting snapd
Change-Id: I9266bbf4f67a2135f9a81b32fe88620be11af6ea
BUG: 1109889
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8084
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Kaushal M <kaushal@redhat.com>
2014-06-17 02:37:32 -07:00
Kaushal M
84d370774c glusterd: Use blocking quotad start only on quota enable
Having quotad always being using the blocking runner variant is
problematic. In some cases where quotad was started from the epoll
thread, it lead to a deadlock which lead to glusterd becoming
unresponsive.

This patch makes the default quotad_start function use the non-blocking
runner_nowait variant. The blocking start is used only when quotad is
started on quota enable command.

Change-Id: Ib27042748d69ea28e68badcfaddf61589aae4eba
BUG: 1109872
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/8082
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-16 19:36:18 -07:00
Pranith Kumar K
d3bd3319af tests: Avoid sleep
Change-Id: I7169be3532232754b9461c4e1b27bf6bc857f7a6
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8083
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 11:11:28 -07:00
Krishnan Parthasarathi
6e33d85581 glusterd: Fail peer probe/detach commands when peer detach is ongoing
Change-Id: Ifd8099bc235eb395e8fd9ead3197bef71c78042b
BUG: 1109812
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/8079
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 10:03:12 -07:00
Venkatesh Somyajulu
de22a20a76 cluster/dht: make loc->inode instead of loc->parent
parent's inode should be taken from loc->inode.

Change-Id: I979b7333efa93b1e8f4c73ccf048d48e308f9289
BUG: 1104653
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/8073
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 09:11:14 -07:00
Nithya Balachandran
7382b66de7 Cluster/DHT: New logging framework
Moved all relevant DHT gf_log calls to the new logging
framework.

Change-Id: I3af3cfe0416e332774a6c4ff6a091d006c400af2
BUG: 1075611
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/7929
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 06:25:51 -07:00
Raghavendra Bhat
0031bd1d18 mgmt/glusterd: volume stop should also stop its snapview-daemon
Change-Id: I702372c6c8341b54710c531662e3fd738cfb5f9a
BUG: 1109770
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8076
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 06:14:52 -07:00
Anand Subramanian
4f9dff83ad Minor fixes for correcting the goto statements for frame destroy and checking pthread_mutex_lock return values
* Also some coverity fixes

Signed-off-by: Anand Subramanian <anands@redhat.com>

Change-Id: I0c27b913e62b0a072e508e37a3fb3421a9ca9503
BUG: 1105439
Signed-off-by: Anand Subramanian <anands@redhat.com>
Reviewed-on: http://review.gluster.org/8071
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 05:19:56 -07:00
Susant Palai
b8f3aab95f DHT/readdirp: Directory not shown/healed on mount point if exists
on single brick(non first up subvolume).

Problem: If snapshot is taken, when mkdir has succeeded only on
hashed_subvolume, then after restoring snapshot the directory
is not shown on mount point.

Why:    dht_readdirp takes only those directory entries in to
account, which are present on first_up_subvolume. Hence, if the
"hashed subvolume" is not same as first_up_subvolume, it wont be listed
on mount point and also not healed.

Solution:
Case 1: (Rebalance not running)If hashed subvolume is NULL or down then
filter in first_up_subvolume. Other wise the corresponding hashed subvolume
will take care of the directory entry.

Case 2: If readdirp_optimize option is turned on then read from first_up_subvol

Change-Id: Idaad28f1c9f688dbfb1a8a3ab8b244510c02365e
BUG: 1092433
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/7599
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 05:14:20 -07:00
Kotresh H R
62265f40d7 features/changelog: Do not ignore self-heal fops in changelog
Problem: Geo-rep fails to sync some files to slave as the
changelog entries are missing for those files.

Cause: Fops happened when the active brick is down and
self- healed later when it came up.

Solution: Capture self-heal fops as well in changelog so
those entries are not missed.

Change-Id: Ibc288779421b5156dd1695e529aba0b602a530e0
BUG: 1109692
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8070
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 04:23:37 -07:00
Sachin Pandit
452eea5c43 glusterd/snapshot : override postvalidate for few snapshot commands.
snapshot info, list, config display and status does not
require any operations to be performed during postvalidate stage.
Hence it is better to override these commands in postvalidate.
Or else there will be a warning in log message saying "postvalidation
failed".

Change-Id: I14d64f7bf9adee8821067dd74d5027215d7b02f8
BUG: 1106406
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8014
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2014-06-16 04:09:16 -07:00
Pranith Kumar K
7342076f42 tests: Validate self-heal daemon completions
Removed sleep with EXPECT_WITHIN
Heal full doesn't generate indices until the files/dirs are
recreated. So wait until they are re-created and then
wait for heal completion.

Change-Id: I82399f6a17f94ecc101db45b83d8ef7bfa9c64dd
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8069
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-16 03:15:32 -07:00
Varun Shastry
47230eb38d features/quota: No root squash for quota aux mount by default
With change 28209283a67f13802cc0c1d3df07c676926810a2, the root squash option
is enabled by default even for the trusted clients. This disallowed quota
auxiliary mount from setting the limit.

This patch adds the quota aux mount process to list of 'special' clients which
have the root squash disabled by default.

Change-Id: Ie6583dd3deb170563daf001239c51bcff1ce078b
BUG: 1104692
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/7967
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2014-06-15 23:12:50 -07:00
Anand Subramanian
ec845d93e7 Get snapshot info dynamically via new rpc and infra for snapview-server to refresh snaplist
BUG: 1105439
Change-Id: I4bb312a53d88f6f4955e69a3ef2b4955ec17f26d
Signed-off-by: Anand Subramanian <anands@redhat.com>
Reviewed-on: http://review.gluster.org/8001
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-15 10:33:23 -07:00
Pranith Kumar K
056b99bfbc tests: Fix spurious failure for tests/bugs/bug-918437-sh-mtime.t
Change-Id: I355ae02bed54753480279ddb058cc4b19ace6792
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8068
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-15 08:16:48 -07:00
Venkatesh Somyajulu
72c7afcd09 dht/rebalance: Do not allow rebalance when gfid mismatch found
Due to race condition, it may so happen that, gfid obtained
in readdirp and gfid found by lookup are different for a given
name. in that case do no allow the rebalance.

Readdirp of an entry will bring the gfid, which will be stored
in the inode through inode_link, and when lookup is done and
gfid brought by lookup is different from the one stored in the
inode, client3_3_lookup_cbk will return ESATLE and error will be
captured by rebalance process.

Change-Id: Iad839177ef9b80c1dd0e87f3406bcf4cb018e6fa
BUG: 1104653
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/7973
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-14 10:55:41 -07:00
Joe Julian
ced0dcd817 doc: Fix peer probe deficiencies
Added the command to probe the first server to assign it a hostname

Change-Id: I9c25f1ce3175e1ffe024f6b6ae14a4526228489a
BUG: 1095594
Reviewed-on: http://review.gluster.org/7852
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-14 06:49:55 -07:00
Nithya Balachandran
2244879873 Modified Gluster man page
Change-Id: I03c910012eca29a7fbca3728827d99b80374ce9c
BUG: 1097051
Reviewed-on: http://review.gluster.org/7745
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-14 05:53:30 -07:00
Pranith Kumar K
12b7797bfb Fix resolution issues across fuse/server/afr
Problems with fuse/server:
Fuse loc touch up sets loc->name even when pargfid
is not known. Server lookup does (pargfid, name) based
lookup when name is set ignoring the gfid. Because of this server
resolver finds that the lookup came on (null-pargfid, name) and
fails the lookup with EINVAL.

Fix:
Don't set loc->name in loc_touchup if the pargfid is not known.
Did the same even for server-resolver

Problem with afr:
Lets say there is a directory hierarchy a/b/c/d on the mount and the
user is cd'ed into the directory. Bring down one of the bricks of replica and
remove all directories/files to simulate disk replacement on that brick. Now
this brick is brought back up. Creates on the cd'ed directory fail with ESTALE.
Basically before sending a create of 'f' inside 'd', fuse sends a lookup to
make sure the file is not present.  On one of the bricks  'd' is present and
'f' is not so it sends ENOENT as response. On the new brick 'd' itself is not
present. So it sends ESTALE. In afr ESTALE is considered to be special errno on
witnessing which lookup has to fail. And ESTALE is given more priority than
ENOENT. Due to these reasons lookup fails with ESTALE rather than ENOENT. Since
lookup didn't fail with ENOENT, 'create' can't be issued so the command is
failed with ESTALE.

Solution:
Afr needs to consider ESTALE errno normally and ENOENT needs to
be given more priority so that operations like create can proceed even when
only one of the brick is up and running. Whenever client xlator identifies
that gfid-changed, it sets that information in lookup xdata. Afr uses this
information to fail the lookup with ESTALE so that top xlator can send
fresh lookup.

Change-Id: Ica6ce01baef08620154050a635e6f97d51029ef6
BUG: 1106408
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8015
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-14 04:10:06 -07:00
Avra Sengupta
7aa3630b1f glusterd/snapshot: Update fstype and fsuuid
Update fstype and fsuuid before creating missed snapshot

Change-Id: Ie9af0065fab288bd1c1a26396428f0cee6335f97
BUG: 1109142
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/8062
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Justin Clift <justin@gluster.org>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-13 20:55:27 -07:00
Krutika Dhananjay
56438208c8 cleanup: Fix order of arguments passed in log message
Change-Id: Iae85cdfc223875688ea17155fffcf2a3a435d245
BUG: 764890
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8044
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-06-13 10:42:40 -07:00
Justin Clift
053389c89e tests: add missing check for yajl to run-tests.sh
Also add it to the regression test Requires line, along with other
missing dependencies.

Change-Id: I2a83eb6797bafe8883d90565bb4c1ab93c074644
BUG: 1108958
Reviewed-on: http://review.gluster.org/8054
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 09:59:20 -07:00
Krutika Dhananjay
85055f8a90 logging: Flush log messages logged via gf_log_callingfn()
Change-Id: Id1d83a6c5985dd57ef3cf1e3d2f4d04ff2dbabfa
BUG: 889157
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8058
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 09:58:24 -07:00
Varun Shastry
17f3667221 extras: bash command completion for gluster
Change-Id: Ifd6e68b0288dc65e41e467b4ad02bfc3bded341f
BUG: 1108767
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/7979
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 09:56:39 -07:00
Raghavendra Bhat
a41f212e4b get the path from the loc->path in the lookup instead of resolver doing it
Change-Id: I7448e1199f4fd32fb0ae127b36dcf06641a153a9
BUG: 1108887
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8053
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 09:54:43 -07:00
Kaushal M
a6585d9c5e glusterd: More snapshot backward compatability fixes
Several volume operations, start, add-brick and replace-brick, expected
the presence of a bricks mount directory, which is required for the
snapshot feature. This should only be expected when snapshot is
supported in the cluster.

Change-Id: I92017bb5e069392352f9800cef1ddc80045fda35
BUG: 1101903
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/8046
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-13 04:41:22 -07:00
Avra Sengupta
5b0f65717f glusterd/snapshot: Fix snap delete cleanup
During commit the first thing that should happen is the
snaps should be marked as GD_SNAP_STATUS_DECOMMISSION.
So that if the node goes down the marked snap can be
cleaned up when the node is coming back. Also during snap
handshake while accepting snapshot from peer, we should
check if the snap in question is decomissioned. In that
case we shouldn't be accepting the peer data.

Change-Id: Ib4e38d1b6bf49411928623fbc9f72f2b37b72086
BUG: 1104714
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7996
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-13 04:41:08 -07:00
Rajesh Joseph
60e8fdfeeb glusterd/snapshot: Fix for snapshot restore failure
Problem: If restore fails due to quorum failure then the subsequent restore fails.

Cause: Volume store is backed up during prevalidate failure and it is
reverted or cleaned based on failure or success of the commit phase.
In case of quorum failure we were not reverting the backup.

Fix: Take backup when all the validation is done including quorum check.

Change-Id: I55d57f6ee85fac04a0e6cbd0291a402601c725d6
BUG: 1109024
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/8056
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-13 02:36:28 -07:00
Sachin Pandit
10cd2bc38e glusterd/snapshot : Provide enable/disable option for snapshot auto-delete feature.
This patch provides an interface to enable or disable
the auto-delete feature.
Syntax : gluster snapshot config auto-delete <enable/disable>

DETAILS :

1) When auto-delete feature is disabled, If the the soft-limit is
reached then user is given a warning about exceeding soft-limit
along with successful snapshot creation message (oldest snapshot is
not deleted). And upon reaching hard-limit further snapshot creation
is not allowed.

Example :
------------------------------------------------------------------
|Case - 1: Upon reaching soft-limit
|
|Snapshot create : snap successfully created.
|Warning : soft-limit of volume (vol) is reached. Snapshot creation
|is not possible once hard-limit is reached.
|
|-----------------------------------------------------
|Case - 2: Upon reaching hard-limit
|
|Snapshot create : snap creation failed.
|Error : hard-limit of volume (vol) is reached, Hence it is not
|possible to take further snapshots. Please delete few snapshots
|of the volume (vol) before taking another snapshot.
------------------------------------------------------------------

2) When auto-delete feature is enabled, then as soon as the soft-limit
is reached the oldest snapshot is deleted for every successful snapshot
creation (same as existing method), With this it is made sure that
number of snapshot created is not more than snap-max-hard-limit.

Change-Id: Ie3ca64bbd2c763371f541cd2e378314e73b695b4
BUG: 1105415
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8017
Tested-by: Justin Clift <justin@gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 02:12:29 -07:00
Raghavendra Bhat
6ba178fd9e protocol/server: reflect lru limit in inode table also
Upon reconfigure, when lru limit of the inode table is changed,
the new value was just saved in the private structure of the
protocol/server xlator and the inode table used to have the older
values still. A brick start was required for the changes to get
reflected. To handle it, traverse through the xlator tree and check
whether a xlator is a bound_xl or not (if it is a bound_xl it would
have its itable pointer set). If a xlator is a bound_xl, then get
the inode table of that bound_xl and set its lru limit to new value
given via cli. Also prune the inode table so that extra inodes are
purged from the inode table.

Change-Id: I6909be028c116adaa1d1a5108470015b5fc6f09d
BUG: 1103756
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/7957
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2014-06-13 01:49:10 -07:00
Pranith Kumar K
4d656f9008 tests: Fix spurious failure in tests/bugs/bug-830665.t
Problem with script:
EXPECT_WITHIN fails the test if the command it executes fails.
There is a possibility that the file script tries to 'cat' may not exist.
In those cases it would fail leading to spurious failures.

Fix:
Add a function which returns empty string when the file doesn't exist
and 'cat' file when it does exist.

Change-Id: I0abfb343f2fce1034ee4b5b680e3783c4f6e8486
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8057
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-13 01:07:31 -07:00
Pranith Kumar K
333d2a60eb tests: Revert janitor link file removal test
I found that order of execution in afr-v2 self-heal is causing
the links to disappear some times. I need to fix that issue
and then submit this test again

Change-Id: Ia886feb796b7854645813f486b7b7ac4e944ed17
BUG: 1101143
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8055
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 20:35:29 -07:00
Krutika Dhananjay
21f2e1705a cleanup: Fix domain in log message
Change-Id: I554b9bcacf6c8acd6dffea0a485fc50e82c3dc04
BUG: 764890
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8043
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-06-12 19:51:17 -07:00
Kotresh H R
c979139793 feature/changelog: Fix compilation warning 'set but not used'
Change-Id: I37de39aec341fbde9516aa8f8c963b70bd808bac
BUG: 1108034
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8035
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2014-06-12 09:58:07 -07:00
ggarg
997d2fbd2d tests: fix for spurious failure:
Change-Id: I39cc497f12c83aa055acb6e88e4c3e1e8774e577
BUG: 1089668
Signed-off-by: ggarg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/8050
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2014-06-12 08:32:27 -07:00
Avra Sengupta
1f21201a43 glusterd/geo-rep: Create the conf file path correctly
In case of mount brocker, the conf file path needs to
be correctly created, and then fetch the status file

Change-Id: Iaa1b04ee46f10961a7056e834170d68282c36efa
BUG: 1104649
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7977
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-06-12 05:48:54 -07:00
Harshavardhana
665366a72b geo-rep/gverify: Never use ping to check for host reachability
On many linux distributions with iptables enabled, ICMP traffic
is usually dropped even when port 22 is open for SSH service

So practically `ping` is an unreliable command

~~~
root@rhs1:/var/log/glusterfs # gluster volume geo-replication geo-test \
                          17.16.10.1::geo-test-slave create push-pem force
172.16.10.1 not reachable.
geo-replication command failed
~~~

~~~
root@rhs1:/var/log/glusterfs # ping 172.16.10.1
PING rhs2.sjc.redhat.com (172.16.10.1) 56(84) bytes of data.
From rhs2.sjc.redhat.com (172.16.10.1) icmp_seq=1 Destination Host Prohibited
...
...
~~~

~~~
root@rhs2:/var/log/glusterfs # service iptables status | grep 22
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22
root@rhs2:/var/log/glusterfs # service iptables status | grep icmp-host-prohibited
25   REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
~~~

Change-Id: I33206ca071aa5d755c0762f7c486da222ec3c7db
BUG: 1105337
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7997
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-06-12 05:48:23 -07:00
Poornima
073264c631 glusterd/geo-rep: Fix the resource leaks.
Change-Id: Ic741250999880bdf9e1226cd3eefa791fb66a888
BUG: 789278
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6905
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 04:25:08 -07:00
Lalatendu Mohanty
115ecc8da8 Core: Fix issues reported by Cppcheck
Fixed in this patch:

[glusterfs/extras/geo-rep/gsync-sync-gfid.c:105]: (error) Resource leak: fp
[glusterfs/libglusterfs/src/xlator.c:651]: (error) Uninitialized variable: gfid
[glusterfs/libglusterfs/src/xlator.c:652]: (error) Uninitialized variable: gfid
[glusterfs/xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv
[glusterfs/xlators/features/changelog/src/changelog.c:1464]: (error) Possible null pointer dereference: priv
[glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:865]: (error) Possible null pointer dereference: ctx
[glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:194]: (error) Possible null pointer dereference: ctx
[glusterfs/xlators/mgmt/glusterd/src/glusterd-syncop.c:1408]: (error) Possible null pointer dereference: this
[glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7002]: (error) Possible null pointer dereference: path_tokens

Fixed in 3.4 and 3.5 branch (http://review.gluster.org/#/c/7583/ ,
http://review.gluster.org/#/c/7605/ will be backported in a separate patch)

[glusterfs/xlators/mount/fuse/src/fuse-bridge.c:4688]: (error) Uninitialized variable: finh
[glusterfs/xlators/mount/fuse/src/fuse-bridge.c:3081]: (error) Possible null pointer dereference: state
[glusterfs/xlators/cluster/dht/src/dht-rebalance.c:1719]: (error) Possible null pointer dereference: ctx
[glusterfs/xlators/cluster/stripe/src/stripe.c:4940]: (error) Possible null pointer dereference: local
[glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:915]: (error) Resource leak: file
[glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:999]: (error) Resource leak: file
[glusterfs/xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx
[glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:5297]: (error) Possible null pointer dereference: this
[glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:6273]: (error) Possible null pointer dereference: this
[glusterfs/xlators/performance/quick-read/src/quick-read.c:586]: (error) Possible null pointer dereference: iobuf
[glusterfs/xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it).

False positives

[glusterfs/geo-replication/src/gsyncd.c:99]: (error) Memory leak: str
[glusterfs/geo-replication/src/gsyncd.c:395]: (error) Memory leak: argv
[glusterfs/xlators/nfs/server/src/nlm4.c:1199]: (error) Possible null pointer dereference: fde
[glusterfs/xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1659]: (error) Possible null pointer dereference: command
[glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7001]: (error) Possible null pointer dereference: path_tokens

Insignificant/Don't care

[glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 2) requires 'long *' but the argument type is 'unsigned long *'.
[glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 3) requires 'long *' but the argument type is 'unsigned long *'.
[glusterfs/extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments.
[glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr
[glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr
[glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr

Change-Id: I7696ed1a2a9553b79f9714e10210a8d563a5abd8
BUG: 1091677
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/7693
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 04:20:34 -07:00
Sachin Pandit
75279b20e9 tests : Fix for spurious failure of bug-1104642.t.
Problem :
This test case checks whether global option is updated
when glusterd goes down and comes back up.

There might be a scenario where the handshake is not
completed yet and we issue a volume info in between.
In that case when we try to grep a key from gluster volume info
output it might not be there.

Hence to get some time we can issue a peer status command
and verify that the peer count is correct.

Change-Id: I2933d55ce8c80517a555fa3c2e4cd768cde30abf
BUG: 1104642
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8041
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 03:58:03 -07:00
Raghavendra Talur
8a2454d449 extras/hookscripts: When set option disables smb, don't start smb.
When user.smb or user.cifs option is set to disable, we remove the
share options from smb.conf. If smb process is running, a sighup is
required but we should not start the process if its not running.

Change-Id: I1e2163ff209ba858380f7da459ff1dba3cf673f2
BUG: 1105123
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/7994
Reviewed-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 03:57:14 -07:00
Pranith Kumar K
254a5e484b tests: Add fops sanity
Original-Authors: MS Vishwanath and Sachidananda URS

Change-Id: I7a76b74fc4de24a2d7ec5932ff2c47754abf0521
BUG: 1084422
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/7928
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-12 03:45:52 -07:00
Rajesh Joseph
f1705e2d33 glusterd/snapshot: Update file-system uuid during snap creation
After the brick snapshot file-system UUID of the origin
brick and the snapshot brick will be identical. If user
is using file-system UUID to mount the backend bricks
then this will result in unexpected behaviour.

Fix: After taking the LVM snapshot create new UUID for
the snapshot brick.

Change-Id: I339c90abd72dd392de195b674ea22217e63dfd48
BUG: 1105484
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/8002
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-06-12 03:12:27 -07:00
Raghavendra Bhat
604ba9abf3 mgmt/glusterd: provide interface for configuring the entry point to snapshots
Change-Id: Ibfd0e43db8e5f3f0f2ab6ec6bed88f71397c0bf4
BUG: 1107531
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/8025
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2014-06-12 01:56:01 -07:00
Pranith Kumar K
d240958fb3 storage/posix: Janitor should guard against dir renames.
Problem:
Directory rename while a brick is down can cause gfid handle of that directory
to be deleted until next lookup happens on that directory.

*) Self-heal does not have intelligence to detect renames at the moment. So it
has to delete the directory 'd' using special flags, because it has to perform
'rm -rf' of that directory as it is not empty. Posix xlator implements this by
renaming the directory deleted to 'landfill' directory in '.glusterfs' where
janitor thread will perform actual rm -rf by traversing the directory. Janitor
thread wakes up every 10 minutes to check if there are any directories to be
deleted and deletes them. As part of deleting it also deletes the gfid-handles.

Steps to hit the problem:
1) On a replicate volume create a directory 'd', file in 'd' called 'f' so the
   directory 'd' is not empty.

2) bring one of the bricks down (lets call it brick-a, the other one is brick-b

3) Rename d to d1

4) When brick-a comes online again, self-heal deletes directory 'd' and creates
   directory 'd1' on brick-a for performing self-heal. So on brick-a,
   gfid-handle of 'd' pointing to 'da is deleted and recreated to point to 'd1'.

5) This directory 'b' with all its directory hierarchy (for now just the file
   'f') will be under 'landfill' directory.

6) When janitor thread wakes up and deletes directory 'd' and gfid-handle of
   'd' without realizing that it is now pointing to 'd1'. Thus 'd1' loses its
   gfid-handle

Fix:
Delete gfid-handle for a directory only when the gfid-handle is stale.

Change-Id: I21265b3bd3852f0967d916aaa21108ae5c9e7373
BUG: 1101143
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/7879
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-06-12 01:10:45 -07:00
Kotresh H R
afeaab53f6 geo-rep/glusterd: Fix glusterd crash during geo-rep config reset.
Problem:
When "\!<config-option>" (i.e., reset) is used in geo-rep config,
glusterd crashes with NULL pointer dereference of 'op_value' in
glusterd_gsync_op_already_set.

Solution:
glusterd_gsync_op_already_set should be called only for geo-rep
set option. So bypass glusterd_gsync_op_already_set for reset.

Change-Id: I9d8ef242abf02011139d76a72564f66d68cc8585
BUG: 1107984
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8032
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-06-12 00:24:13 -07:00
Aravinda VK
ee1ef00e2a geo-rep: Making replica failover check interval configurable
Replica failover check interval is hardcoded to 60 sec
by default. Now this option is made configurable and
defaulted to 1 sec.

To change the default value
gluster volume geo-replication <MASTERVOL> \
	<SLAVEHOST>::<SLAVEVOL> config replica_failover_interval 15

Change-Id: Iada1b80d510452dcfedebd8a21bebd62394b0597
BUG: 1066410
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/8003
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-06-11 23:55:31 -07:00
Aravinda VK
f25c88375b geo-rep: entry_ops errors handling
Xattr.lsetxattr_l call will not raise OSError which
errno_wrap can handle, so we need to use Xattr.lsetxattr
to get proper OSError and errno_wrap ignores or retries
accordingly.

Change-Id: Ie0a777152ddbaf9ed80c977e4704974fec997bea
BUG: 1105083
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/7972
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-06-11 23:52:52 -07:00