8170 Commits

Author SHA1 Message Date
Aravinda VK
d28b226131 tools/glusterfind: Cleanup glusterfind dir after a volume delete
If `glusterfind delete` command was not run before volume delete, stale
session directories exists in /var/lib/glusterd/glusterfind directories.

Also shows these sessions in `glusterfind list`

When Volume is deleted, Post hook will be run which cleans up the stale
session directories

BUG: 1225465
Change-Id: I54c46c30313e92c1bb4cb07918ed2029b375462c
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/10944
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-12 03:01:07 -07:00
Nandaja Varma
72a7a6ea78 sm/glusterd: Porting messages to new logging framework
Change-Id: I391d1ac6a7b312461187c2e8c6f14d09a0238950
BUG: 1194640
Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com>
Reviewed-on: http://review.gluster.org/9927
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>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-12 02:05:29 -07:00
Pranith Kumar K
eeccafc72c features/qemu-block: Add comment about root_inode handling
This is handling the comment on 3.7 backport
http://review.gluster.com/11047

Change-Id: I253a8e0bfebde63f25c839efd55ed3cc30e6cd9b
BUG: 1226276
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11076
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Poornima G <pgurusid@redhat.com>
2015-06-12 01:53:17 -07:00
Nandaja Varma
886f65fabc libglusterfs: Fixing insecure temp file coverity issue
Coverity CID: 1124835

Change-Id: I7e87f2b3bad35cf8a9c64c8502de23662d9f677f
BUG: 789278
Signed-off-by: Nandaja Varma <nvarma@redhat.com>
Reviewed-on: http://review.gluster.org/9565
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Sakshi Bansal
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
2015-06-12 00:48:11 -07:00
Kaleb S. KEITHLEY
04791e4d53 common-ha: handle long node names and node names with '-' and '.' in them
sourcing the /etc/ganesha/ganesha-ha.conf file seemed like a simple
and elegant solution for reading config params, but bash variable names
do not allow '-' and '.' in them.

Also fix incorrect path in shared volume mount

Change-Id: I40140e5da0903221efd316de94dce40229263e15
BUG: 1225572
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/11035
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-11 13:12:11 -07:00
meghana
9eef639e19 common-ha : Clean up persistent cib state
Pacemaker saves old configurations in the
directory, "/var/lib/pacemaker/cib". It's
good to clean up this directory during teardown so that
old data doesn't show up the next time.

Change-Id: If0f413ba2da599dd6672b51e60e1d35e674d576b
BUG: 1228415
Signed-off-by: meghana <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/11093
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-06-11 13:07:45 -07:00
Aravinda VK
076e869c65 tools/glusterfind: Fix GFID to Path conversion for dir
For Directories, GFID to Path conversion was fine, but wrong
filter was used while updating to db.

Change-Id: Id588adbb25ff5fd357f8cc2d5485bd2eb4a52b65
Signed-off-by: Aravinda VK <avishwan@redhat.com>
BUG: 1230127
Reviewed-on: http://review.gluster.org/11158
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-11 12:28:12 -07:00
Saravanakumar Arumugam
07df9b56fd geo-rep: ignore symlink and harlink errors in geo-rep
Ignore logging in case of symlink and hardlink creation
errors, as these are safe errors with respect to
geo-replication.

Change-Id: I3b863fb03ae23dbea907e4dd9477ff85feecad70
BUG: 1225571
Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-on: http://review.gluster.org/10957
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-11 12:21:56 -07:00
Milind Changire
53e84fe1ee tools/glusterfind: verifying volume is online
Volume needs to be online (Started) to perform meaningful
operations i.e. for "create" and "pre". This is now verified.

Change-Id: I207cf1f5e30be0f67a776b866349b59d70a13984
BUG: 1225564
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/10955
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
2015-06-11 12:05:56 -07:00
Joseph Fernandes
46b3fde543 tier/dht: Fixing non atomic promotion/demotion w.r.t to frequency period
This fixes the ping-pong issue i.e files getting demoted immediately
after promition, caused by off-sync promotion/demotion processes.
The solution is do promotion/demotion refering to the system time.
To have the fix working all the file serving nodes should have
thier system time synchronized with each other either manually or
using a NTP Server.

NOTE: The ping-pong issue can re-appear even with this fix, if the admin
have different promotion freq period and demotion freq period, but this
would be under the control of the admin.

Change-Id: I1b33a5881d0cac143662ddb48e5b7b653aeb1271
BUG: 1218717
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/11110
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-06-11 09:45:58 -07:00
Dan Lambright
b1ff2294d2 cluster/tier: account for reordered layouts
For a tiered volume the cold subvolume is always at a fixed
position in the graph. DHT's layout array, on the other hand,
may have the cold subvolume in either the first or second
index, therefore code cannot make any assumptions. The fix
searches the layout for the correct position dynamically
rather than statically.

The bug manifested itself in NFS, in which a newly attached
subvolume had not received an existing directory. This case
is a "stale entry" and marked as such in the layout for
that directory.  The code did not see this, because it
looked at the wrong index in the layout array.

The fix also adds the check for decomissioned bricks, and
fixes a problem in detach tier related to starting the
rebalance process: we never received the right defrag
command and it did not get directed to the tier translator.

Change-Id: I77cdf9fbb0a777640c98003188565a79be9d0b56
BUG: 1214289
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11092
2015-06-11 07:41:11 -07:00
Nandaja Varma
9863c89409 utils/glusterd: Porting to new logging framwork
Change-Id: Iacb30eb675693bcdb3ef9de8e7f43892c5d79f6d
BUG: 1194640
Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com>
Reviewed-on: http://review.gluster.org/9967
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2015-06-11 07:20:33 -07:00
Saravanakumar Arumugam
a6c53571a9 features/changelog: Avoid setattr fop logging during rename
Problem:
        When a file is renamed and the (renamed)file's Hashing
falls into a different brick, DHT creates a special file(linkto file)
in the brick(Hashed subvolume) and carries out setattr operation
on that file.

Currently, Changelog records this(setattr) operation in Hashed
subvolume. glusterfind in turn records this operation
as MODIFY operation.

So, there is a NEW entry in Cached subvolume and MODIFY entry
in Hashed subvolume for the same file.

Solution:
        Avoid logging setattr operation carried out, by
marking the operation as internal fop using xdata.

In changelog translator, check whether setattr is set
as internal fop and skip accordingly.

Change-Id: I21b09afb5a638b88a4ccb822442216680b7b74fd
BUG: 1230007
Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-on: http://review.gluster.org/11137
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-11 05:19:09 -07:00
Sachin Pandit
3eafe6a81f features/marker : Pass along xdata to lower translator
The problem was in marker xlator, where during
rename a NULL value is passed during STACK_WIND.
Marker needs to pass the xdata un-modified to next
translator if marker does not rely on that.

Change-Id: I9e47e504fd241263987645abfed7ca13c0d54a80
BUG: 1228492
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/11089
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-11 04:33:31 -07:00
Niels de Vos
515feb9885 build: improve detection of new OpenSSL features
Building on Mac OS X revealed that the current check for
CRYPTO_THREADID_set_callback() availability in OpenSSL is not correct.

There also does not seem to be a guarantee that TLSv1_2_method() is
available when TLS1_2_VERSION is #define'd.

Change-Id: I21508065fc181a1c74bee4fd6d23bb5bdf7cea7a
BUG: 1222317
Original-author: Kaleb KEITHLEY <kkeithle@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11140
Reviewed-by: Kaleb KEITHLEY <kkeithle@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>
2015-06-11 01:33:09 -07:00
Avra Sengupta
71f27128cb snapshot/scheduler: Reload /etc/cron.d/glusterfs_snap_cron_tasks when shared storage is available
If shared storage is not accessible, create a flag in /var/run/gluster/
So that when /etc/cron.d/glusterfs_snap_cron_tasks is
available again, the flag will tell us, to reload
/etc/cron.d/glusterfs_snap_cron_tasks

Change-Id: I41b19f57ff0b8f7e0b820eaf592b0fdedb0a5d86
BUG: 1218573
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11139
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-11 00:08:17 -07:00
Mohammed Rafi KC
fefc8730e2 glusterd/tier: glusterd crashed with detach-tier commit force
glusterd crashed when doing "detach-tier commit force" on a
non-tiered volume.

Change-Id: I884771893bb80bec46ae8642c2cfd7e54ab116a6
BUG: 1228112
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11081
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Joseph Fernandes
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-11 00:02:25 -07:00
Pranith Kumar K
5c00a6c816 cluster/ec: Wind unlock fops at all cost
Problem:
While files are being created if more than redundancy number of bricks
go down, then unlock for these fops do not go to the bricks. This will
lead to stale locks leading to hangs.

Fix:
Wind unlock fops at all costs.

Change-Id: I50a87e8b4d6d2dde5bf7405b82e3aeecd95ad00e
BUG: 1220348
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11152
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
2015-06-10 23:37:07 -07:00
Niels de Vos
ec7d0c3de1 logging: log "Stale filehandle" on the client as Debug
There are valid use-cases where a "Stale filehandle" is expected. One of
these is deleting a file through NFS-Ganesha. When the "filename" is
deleted, Ganesha will stat the file-handle to update its attributes. The
file-handle would still be valid in the case where there are hardlinks.

There is no need to log "Stale filehandle" as Warning. It is perfectly
fine to have this logged as Debug.

Change-Id: Ib9006d95a5d1f7dd394bf5d5994ad70740ad4ab2
BUG: 1228731
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11107
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
2015-06-10 16:01:58 -07:00
Avra Sengupta
5b05d3e376 snapshot/scheduler: Check if GCRON_TASKS exists before
accessing it's mtime

Change-Id: I873c83d21620527b20d7de428d11582c5499d1af
BUG: 1228613
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11138
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-10 03:02:20 -07:00
Mohamed Ashiq
00f9a61fe8 changetimerecorder : Porting to new logging framework
Change-Id: I66e7ccc5e62482c3ecf0aab302568e6c9ecdc05d
BUG: 1194640
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/10938
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
2015-06-10 01:58:01 -07:00
Mohamed Ashiq
2847b03a38 gfdb/libglusterfs : Porting to a new logging framework
Change-Id: I61874561fdf2c175d2b3eec0c85c25f12dc60552
BUG: 1194640
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/10819
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
2015-06-10 01:54:14 -07:00
Sakshi Bansal
9374b2ef41 glusterd: coverity fix for string overflow
Coverity CID: 1222523
Coverity CID: 1210990
Coverity CID: 1229877
Coverity CID: 1229876
Coverity CID: 1124855

Change-Id: Iba615724909216f923074cb4585940b919d02166
BUG: 789278
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/9555
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-10 01:50:04 -07:00
arao
9307b94394 glusterd: Dereference after null check
CID: 1124588
CID: 1124589
CID: 1124590
CID: 1124591
Either the null pointer is dereferenced before the null check
or the check for null is unnecessary

Change-Id: I87c6b09a4b89c33afd402866e6e249fefb1330f0
BUG: 789278
Signed-off-by: arao <arao@redhat.com>
Reviewed-on: http://review.gluster.org/9636
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: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-10 01:38:59 -07:00
Mohammed Rafi KC
f6a062044a tier/volume set: Validate volume set option for tier
Volume set option related to tier volume can only be set
for tier volume, also currently all volume set i for tier
option accepts a non-negative integer. This patch validate
both condition.

Change-Id: I3611af048ff4ab193544058cace8db205ea92336
BUG: 1216960
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/10751
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Joseph Fernandes
2015-06-10 01:08:47 -07:00
Avra Sengupta
d835219a30 snapshot/scheduler: Handle OSError in os. callbacks
Handle OSError and not IOError in os. callbacks.

Change-Id: I2b5bfb629bacbd2d2e410d96034b4e2c11c4931e
BUG: 1218060
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11087
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-09 23:40:52 -07:00
anand
cd6dc49fb3 libglusterfs: Enabling the fini() in cleanup_and_exit()
Problem 1 : glusterd was crashing due to race between clean up thread and rpc event thread.

Scenario:
As we can observed, X thread is in the process of exiting the process. It has already
run the exit handlers, which cleanup things that require cleaning up. This includes
liburcu resources. By the time Y thread  called rcu_bp_register(), the liburcu resources
have been cleaned up. rcu_bp_register() tries to access these non-existent resources,
which leads to the segmentation fault.

Note1:
Crash happen when the process is almost at the point of stopping(exiting), it doesn't have any
serious impact to functionality apart from creating the core dump file and the log message.

Fix .Do proper clean up before calling exit().

Note2: Other xlator have clean up issues,so only glusterd clean up function invoked.

Note3: This patch also solve the selinux issue.

Problem 2 : glusterd runs as rpm_script_t when it's executed from the rpm scriptlet,files created
in this context are set as rpm_script_t, so glusterd unable to access these files when it runs
in glusterd_t context.

Fix: Fini clean up the files while glusterd exiting, so files are recreated by glusterd while
starting with proper SElinux context label.

Change-Id: Idcfd087f51c18a729bdf44a146f9d294e2fca5e2
BUG: 1209461
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/10894
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-09 10:58:48 -07:00
Shyam
ce2488ac2a cluster/dht: Increment op-version for lookup-optimize to 3.7.2
3.7.1 has already shipped, so carrying this configuration option
at that op-version will break compatibility. As a result bumping
this to 3.7.2.

Change-Id: I603d82184ec10d0ea3edf550490e960a8523d572
BUG: 1227894
Signed-off-by: Shyam <srangana@redhat.com>
Reviewed-on: http://review.gluster.org/11073
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-09 07:40:15 -07:00
Shyam
5e08bf5b35 doc: Adding documentation for DHT lookup-optimize option
This is intended to be admin facing documentation, with some granular
details.

Change-Id: I379f8cea5375649fba915e907648e3a71344092d
BUG: 1228818
Signed-off-by: Shyam <srangana@redhat.com>
Reviewed-on: http://review.gluster.org/11109
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-09 07:08:17 -07:00
Soumya Koduri
b77c8ddda8 Upcall/cache-invalidation: Ignore fops with frame->root->client not set
Server-side internally generated fops like 'quota/marker' will
not have any client associated with the frame. Hence we need a
check for clients to be valid before processing for upcall cache
invalidation. Also fixed an issue with initializing reaper-thread.

Added a testcase to test the fix.

Change-Id: If7419b98aca383f4b80711c10fef2e0b32498c57
BUG: 1227204
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/10909
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-09 06:46:20 -07:00
Emmanuel Dreyfus
c51eb694bc Tests portability: umount(8)
1) Avoid hangs on unmounting NFS on NetBSD

NetBSD umount(8) on a NFS mount whose server is gone will wait forever
because umount(8) calls realpath(3) and tries to access the mount before
it calls unmount(2). The non-portable, NetBSD-specific umount -R flag
prevent that behavior.

We therefore introduce UMOUNT_F, defined as "umount -f" on Linux and
"umount -f -R" on NetBSD to take care of forced unmounts, especially
in the NFS case.

2) Enforce usage of force_umount wrapper with timeout

Whenever umount is used it should be wrapped in force_umount with
tiemout handling. That saves us timing issues, and it handles the
NetBSD NFS case.

3) Cleanup kernel cache flush.

We used (cd $M0 && umount $M0 )	as a portable kernel cache flush
trick, but it does not flush everything we need on Linux. Introduce
a drop_cache() shell function that reverts to previously used
echo 3 > /proc/sys/vm/drop_caches on Linux, and keeps
(cd $M0 && umount $M0 ) on other systems.

BUG: 1129939
Change-Id: Iab1f5a023405f1f7270c42b595573702ca1eb6f3
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/11114
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-09 06:24:47 -07:00
Mohamed Ashiq
a2a370db6d libglusterfs: Introducing new logging message
Change-Id: I137f1b7805895810b8e6f0a70a183782bf472bf5
BUG: 1194640
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/9898
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
2015-06-09 01:53:18 -07:00
Pranith Kumar K
31866a490e cluster/ec: Prevent double unwind
Problem:
1) ec_access/ec_readlink_/ec_readdir[p] _cbks are trying to recover only from
ENOTCONN.
2) When the fop succeeds it unwinds right away. But when its
ec_fop_manager resumes, if the number of bricks that are up is less than
ec->fragments, the the state machine will resume with -EC_STATE_REPORT which
unwinds again. This will lead to crashes.

Fix:
- If fop fails retry on other subvols, as ESTALE/ENOENT/EBADFD etc are also
recoverable.
- unwind success/failure in _cbks

Change-Id: I2cac3c2f9669a4e6160f1ff4abc39f0299303222
BUG: 1228952
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11111
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-06-08 22:09:20 -07:00
Krutika Dhananjay
7ca78f7a64 cluster/afr: Do not attempt entry self-heal if the last lookup on entry failed on src
Test bug-948686.t was causing shd to dump core due to gfid being NULL.
This was due to the volume being stopped while index heal's in progress,
causing afr_selfheal_unlocked_lookup_on() to fail sometimes on the src brick
with ENOTCONN. And when afr_selfheal_newentry_mark() copies the gfid off the
src iatt, it essentially copies null gfid. This was causing the assertion
as part of xattrop in protocol/client to fail.

Change-Id: I237a0d6b1849e4c48d7645a2cc16d9bc1441ef95
BUG: 1229172
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11119
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-08 20:24:23 -07:00
Ashish Pandey
f57c2d1ecb Changing log level to DEBUG in case of ENOENT
Change-Id: I264e47ca679d8b57cd8c80306c07514e826f92d8
BUG: 1193388
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/10784
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
2015-06-08 06:19:15 -07:00
anand
0dff9120d5 glusterd: Stop tcp/ip listeners during glusterd exit
Problem : Because of race between exit thread and rpc thread
causing the glusterd crash while glusterd exiting/stoping.

Fix : Stop tcp/ip socket listeners in cleanup_and_exit to
avoid new rpc events.

Change-Id: Ie9280c8c9d7c350a176529375d861432f3de94ac
BUG: 1209461
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/10197
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2015-06-07 23:12:27 -07:00
Prasanna Kumar Kalever
f5095fdb7a gfid-access: Remove dead increment (dead store)
This patch remove stores to variables that are no longer live.

Change-Id: Ib6acd8c70cbb7ea875c01b7cfd6620ac1d641d36
BUG: 1223378
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Reviewed-on: http://review.gluster.org/10841
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-07 13:28:45 -07:00
Niels de Vos
ffe8b4d814 rpm: add option "--with debug" for rpmbuild/mock
When passing "--with debug" to mock or rpmbuild, the build process will
add the "--enable-debug" option to ./configure. This makes it easier
to build RPMs with debugging enabled.

Change-Id: Ie584a4a03525385b337bbf81e5093f2af1b0b780
BUG: 1198849
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11020
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2015-06-07 11:33:35 -07:00
Pranith Kumar K
3373379303 cluster/ec: Don't handle EC_XATTR_DIRTY in response
Problem:
ec_update_size_version expects all the keys it did xattrop with to come in
response so that it can set the values again in ec_update_size_version_done.
But EC_XATTR_DIRTY is not combined so the value won't be present in the
response. So ctx->post/pre_dirty are not updated in
ec_update_size_version_done. So these values are still non-zero. When
ec_unlock_now is called as part of flush's unlock phase it again tries to
perform same xattrop for EC_XATTR_DIRTY. But ec_update_size_version is not
expected to be called in unlock phase of flush because ec_flush_size_version
should have reset everything to zero and unlock is never invoked from
ec_update_size_version_done for flush/fsync/fsyncdir. This leads to stale lock
which leads to hang.

Fix:
EC_XATTR_DIRTY is removed in ex_xattrop_cbk and is never combined with other
answers. So remove handling of this in the response.

Change-Id: If0ea3efec3235a6e312465d8838585fbe752c7ea
BUG: 1227654
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11078
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-06 22:35:43 -07:00
Anuradha
8f12fae9cb heal : Do not invoke glfs_fini for glfs-heal commands
Change-Id: I2fa6789488c4ecebbed049f46c189441fba48535
BUG: 1228635
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/11103
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-06 09:50:03 -07:00
Ravishankar N
02ccab9257 glusterd/ afr: remove the readdir-failover option from rebalance process
Remove the "replicate*.readdir-failover=off" xlator option from
rebalance process' runner arguments because this is the default behaviour in
afr-v2. i.e. reaaddir failover happens only if it is a new readdir
(offset=0). 'Continuing'readdirs are always wound on the same child
where the first readdir had happened and if that child is down, the
readdir fails.

The option cannot be removed from glusterd_volopt_map because there is a
chance of ending up in peer rejected state in a heterogenous cluster
(typical upgrade scenario) due to volinfo checksum mismatch. TODO:come up with
some warning message to the user for such deprecated options if a volume
set is attempted.

Change-Id: I6a33dc9fae7cccea8c5fd3d9de40d88d13ad3689
BUG: 1225328
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/10935
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
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>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-05 04:25:15 -07:00
Krishnan Parthasarathi
5441db69f8 rpc: call transport_unref only on non-NULL transport
BUG: 1227583
Change-Id: Ifac4dd8c633081483e4eba9d7e5a89837b2a453a
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/11041
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>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-05 02:59:01 -07:00
Avra Sengupta
bf3a6dcdf3 snapshot: Fix finding brick mount path logic
Previously while finding brick mount paths
of snap volume's bricks, we were taking brick order
into consideration. This logic fails when a brick is
removed or a tier is added.

Hence modifying the logic to look for the first
occurence of the word "brick" in the brick path.
From there we iterate till we find a '/'. The string
till the first '/' after we encounter the word brick
is the brick mount path.

Change-Id: Ic85983c4e975e701cdfd4e13f8e276ac391a3e49
BUG: 1227646
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11060
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-05 02:22:00 -07:00
Vijay Bellur
d2d7afefd8 features/marker: Cleanup loc in case of errors
Missing loc_wipe() for error paths in mq_readdir_cbk() can
cause memory leaks. loc_wipe() is now done for both happy
and unhappy paths.

Change-Id: I882aa5dcca06e25b56a828767fb2b91a1efaf83b
BUG: 1227904
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/11074
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-04 22:37:49 -07:00
Mohammed Rafi KC
f1c20897cc uss: Take ref on root inode
If we recieve a statfs call on snap directory, we will redirect
the call into the root, by creating a new root loc. So it is better to
take a ref on the root inode.
(http://review.gluster.org/#/c/10358/5/xlators/features/
snapview-client/src/snapview-client.c)

Change-Id: I5649addac442d391b2550346b115dec58fed5b86
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/10750
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
2015-06-04 04:49:03 -07:00
Gaurav Kumar Garg
a615f6c078 tests/bitrot: Induce delay before invoking bitrot subcommands
This is to prevent access to uninitialized variable in reconfigure()
that's currently getting inititlized on CHILD_UP.

[
    NOTE: This is a temporary fix and would not be needed when BZ
           #1226666 is fixed.
]

Change-Id: I8779073fe7f315a380b833ddc248c99958de67d0
BUG: 1226902
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/11033
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>
2015-06-04 03:51:40 -07:00
Avra Sengupta
402589f58c glusterd/shared_storage: Provide a volume set option to create and mount the shared storage
Introducing a global volume set option(cluster.enable-shared-storage)
which helps create and set-up the shared storage meta volume.

gluster volume set all cluster.enable-shared-storage enable

On enabling this option, the system analyzes the number of peers
in the cluster, which are currently connected, and chooses three
such peers(including the node the command is issued from). From these
peers a volume(gluster_shared_storage) is created. Depending on the
number of peers available the volume is either a replica 3
volume(if there are 3 connected peers),  or a replica 2 volume(if there
are 2 connected peers). "/var/run/gluster/ss_brick" serves as the
brick path on each node for the shared storage volume. We also mount
the shared storage at "/var/run/gluster/shared_storage" on all the nodes
in the cluster as part of enabling this option. If there is only one node
in the cluster,  or only one node is up then the command will fail

Once the volume is created, and mounted the maintainance of the
volume like adding-bricks, removing bricks etc., is expected to
be the onus of the user.

On disabling the option, we provide the user a warning, and on
affirmation from the user we stop the shared storage volume, and unmount
it from all the nodes in the cluster.

gluster volume set all cluster.enable-shared-storage disable

Change-Id: Idd92d67b93f444244f99ede9f634ef18d2945dbc
BUG: 1222013
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/10793
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-04 02:37:19 -07:00
Milind Changire
c2898f0409 tools/glusterfind: verifying volume presence
An invalid volume name passed to "pre", "post" and  "delete"
operations throws up unfriendly errors. This patch presents
friendly error messages.

Change-Id: I233809653379b80b34c2e74c0b6f4fe502c8961e
BUG: 1225424
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/10945
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
2015-06-04 00:08:48 -07:00
nnDarshan
b15ee49c94 snapshot/scheduler: Modified main() function to take arguments.
Modified the main function to take script arguments, so that this
script can be used as a module by other programs .

Change-Id: I902f0bc7ddfbf0d335cc087f51b1a7af4b7157fc
BUG: 1220670
Signed-off-by: n Darshan <dnarayan@redhat.com>
Reviewed-on: http://review.gluster.org/10760
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-04 00:00:40 -07:00
Gaurav Kumar Garg
1a0d76fa14 glusterd: do not show pid of brick in volume status if brick is down.
glusterd is currently showing pid of brick in volume status if brick
goes down.

It should not show pid of brick if brick is down.

Change-Id: I077100d96de381695b338382808bd8c37bf625c7
BUG: 1223772
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/10877
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-03 23:59:58 -07:00