84 Commits

Author SHA1 Message Date
Sakshi
1b420a3f69 cli: different status output for rebalance fix-layout
Change-Id: I6ded40a1b1cff5c72e5b61fd353db3d8c688efd8
BUG: 1225718
Signed-off-by: Sakshi <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/10956
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
2016-07-03 22:39:17 -07:00
Krutika Dhananjay
a45bef14b3 tests: Add more tests for granular entry self-heal feature
Change-Id: I6f14e413c538e392c8ee5bf4bf9f283e8ac792b7
BUG: 1332566
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/14542
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2016-05-30 21:23:55 -07:00
Avra Sengupta
0a43265f1b nsr/jbr: Renaming nsr to jbr
As per community consensus, we have decided to rename
nsr to jbr(Journal-Based-Replication). This is the patch
to rename the "nsr" code to "jbr"

Change-Id: Id2a9837f2ec4da89afc32438b91a1c302bb4104f
BUG: 1328043
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/13899
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2016-04-25 12:05:35 -07:00
Avra Sengupta
b4cbfdac0d nsr: Introducing a happy path test case
Write infra for nsr_server to not send a
CHILD_UP before it gets a CHILD_UP from a
quorum of it's children. Using the CHILD_UP
received in the nsr client translator from
the server, to decide the right time for
starting the I/Os

Change-Id: I9551638b306bdcbc6bae6aeda00316576ea832fe
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/13623
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2016-03-31 10:13:17 -07:00
Krutika Dhananjay
0e048b309b features/shard: Implement discard fop
Change-Id: Ia5bd8d36b21a586df6556fbec3474892d5871229
BUG: 1261841
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/13657
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
2016-03-11 11:10:30 -08:00
Krutika Dhananjay
6df883cef3 tests, shard: fallocate tests refactor
Change-Id: I3f275185f4dcb1939e8074851c8f140c5e40b28d
BUG: 1261841
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/13405
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
2016-03-10 03:16:55 -08:00
Atin Mukherjee
05d3d95afa glusterd: volume get should pick options from priv->opts too
As of now volume get was not looking for all the global options maintained in
option dictionary in glusterd_conf_t. This patch includes the same.

Change-Id: Ib05259a2dcacc4a712cae4217fe4a6553b61da56
BUG: 1300596
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/13272
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2016-03-08 05:58:22 -08:00
Manikandan Selvaganesh
15be1c1a00 tests/quota : improving tests for quota
tests/basic/quota.t includes all the basic test that
needs to be tested for quota. In most of the other
tests specific to bugs(tests/bugs/quota/*), tests
such as creating and starting volume, enabling quota,
setting limit, writing data, doing list have been done
which is essential to write a individual quota test
file, but, if the specific bug just needs to test
*few* particular cases, I have moved those tests
under tests/basic itself to speedup the regressions.

Basics of inode-quota and it's enforcing, renaming
with quota are basic tests and is hence moved under
tests/basic folder.

In other files, I have removed tests which are not
needed, such as 'pidof glusterd' or checking for
'gluster volume info' or if there are any test which
is already being tested under tests/basic and is being
written again.

Change-Id: Iefd6d9529246d59829cc5bf02687a1861d8462a8
BUG: 1294826
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/13216
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2016-03-03 03:52:43 -08:00
Manikandan Selvaganesh
ae165bd6d7 tests/quota : fix failing test on auxiliary mount point
In test file tests/bugs/quota/bug-1049323.t, test "EXPECT "0" get_aux"
fails in Fedora.

In get_aux function we grep for "/var/run/gluster/<volname>" to check
if auxiliary mount point is created and we return 0 on success else we
return 1. In fedora, auxiliary mount point is created on
"/run/gluster/<volname>". So it fails on Fedora.

The patch fixes it by just grepping for "/run/gluster/<volname>".

Change-Id: Icb59395df4a98109eaa8199cbdbdedcd1cbef27a
BUG: 1297740
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/13228
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2016-01-12 10:26:14 -08:00
Ravishankar N
a370013898 tests: handle bad objects during lookup/inode_refresh
Change-Id: I1848f0e9243c9376e0deba6738757350fe8b704a
BUG: 1290965
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/13044
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: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-12-28 03:03:21 -08:00
Kaushal M
ba73b0a25e tests: fix brick_up_status
The brick_up_status function wasn't correct after the introduction of
the RDMA port into the `volume status` output.

It has been fixed to use the XML brick status of a specific brick
instead of normal CLI output.

Change-Id: I5327e1a32b1c6f326bc3def735d0daa9ea320074
BUG: 1289584
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/12913
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-12-09 04:18:21 -08:00
Gaurav Kumar Garg
4348a6af89 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>
2015-11-23 22:25:47 -08:00
Sakshi
bdbd092e2c glusterd : check if all bricks are started before performing remove-brick
Change-Id: Ie9e24e037b7a39b239a7badb983504963d664324
BUG: 1225716
Signed-off-by: Sakshi <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/10954
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>
2015-09-22 10:45:34 -07:00
Ashish Pandey
44e58a9385 ec : trusted.ec.version xattr of all root directories of all bricks should be same.
Problem:
After replacing the brick using "replace-brick" command and running "heal
full", the version of the root directory of the newly added brick is not
getting healed. heal starts running on the dentries of the root but does not
run on root directory.

Solution:
Run heal on root directory.

Change-Id: Ifd42a3fb341b049c895817e892e5b484a5aa6f80
BUG: 1243382
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/11676
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2015-08-29 03:31:58 -07:00
Gaurav Kumar Garg
8e0bf30dc4 glusterd: stop all the daemons services on peer detach
Currently glusterd is not stopping all the deamon service on peer detach

With this fix it will do peer detach cleanup properlly and will stop all
the daemon which was running before peer detach on the node.

Change-Id: Ifed403ed09187e84f2a60bf63135156ad1f15775
BUG: 1255386
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/11509
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>
2015-08-24 22:18:55 -07:00
anand
7255febab2 glusterd: Stop/restart/notify to daemons(svcs) during reset/set on a volume
problem : Reset/set commands were not working properly. reset command returns
success but it not sending notification to svcs if corresponding graph modified.

Fix: Whenever reset/set command issued, generate the temp graph and compare
with original graph and do the fallowing actions
1.) If both graph are identical nothing to do with svcs.
2.) If any changes in graph topology restart/stop service by calling
svc manager.
3)  If changes in options send notify signal by calling glusterd_fetchspec_notify.

Change-Id: I852c4602eafed1ae6e6a02424814fe3a83e3d4c7
BUG: 1209329
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/10850
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>
2015-08-06 23:22:53 -07:00
vmallika
d94b39a8e6 quota: fix quota test case
Below command is wrong way of executing
mutilple command with | (pipe)

local cmd="$CLI volume quota $V0 list $QUOTA_PATH | grep $QUOTA_PATH |
awk '{print \$$FIELD}'"
$cmd
This patch fixes the issue

This patch also fixes testcase inode-quota.t, which checking
quota values in wrongs fields

Change-Id: If28732e6a76ea4bf75560f6496c8f56670915cf9
BUG: 1229297
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11673
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
2015-07-15 23:14:44 -07:00
Gaurav Kumar Garg
1d50088062 glusterd: Pass NULL in glusterd_svc_manager in glusterd_restart_bricks
On restarting glusterd quota daemon is not started when  more than one
volumes are configured and quota is enabled only on 2nd volume.
This is because of while restarting glusterd it will restart all the bricks.
During brick restart it will start respective daemon by passing volinfo of
first volume. Passing volinfo to glusterd_svc_manager will imply daemon
managers will take action based on the same volume's configuration which
is incorrect for per node daemons.

Fix is to pass volinfo NULL while restarting bricks.

Change-Id: I2602002a8ba7762fc1eb08123e79fbcf568ecab4
BUG: 1242875
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/11658
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-07-14 11:39:16 -07:00
vmallika
46d4d7ade0 features/quota : Fix spurious failure
Problem : Basically, in this test case a file is created
which exceeds the quota limit. Once the limit is reached
that file will be deleted. At the same moment we are
testing inode-quota. It can so happen that before the
marker updates the information related to deletion of
file, a new file creation operation comes and sees that
quota limit is still exceeded.

Solution : Inducing a check to see if marker updation
completed successfully.

Updated all the test case which has the similar
machanism and also moved the "usage" function
to a common place "volume.rc"

Change-Id: I36ddbc5ebbf1b74c9d326a0d1d5f3b32f20a906a
BUG: 1229297
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11125
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-07-12 21:34:53 -07:00
vmallika
c2cd3aeb0d quota/marker: fix spurious failure afr-quota-xattr-mdata-heal.t
During quota-update process if inode info is present in size-xattr and
missing in contri-xattrs, then in function '_mq_get_metadata', we set
contri-size as zero (on error -2, which means usage info present, but inode info missing).
With this we are calculating wrong delta and updating the same.

With this patch we are ignoring errors if inode info in xattrs are missing

Change-Id: I7940a0e299b8bb425b5b43746b1f13f775c7fb92
BUG: 1241153
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11583
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-07-10 01:20:44 -07:00
Pranith Kumar K
c6742adc98 cluster/ec: Make background healing optional behavior
Provide options to control number of active background heal count and qlen.

Change-Id: Idc2419219d881f47e7d2e9bbc1dcdd999b372033
BUG: 1237381
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11473
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-07-06 03:31:27 -07:00
Ravishankar N
264776f7af tests: fix basic/afr/replace-brick-self-heal.t failure
Test fails with:
not ok 28 Got "Binary file (standard input) matches" instead of "qwerty"
FAILED COMMAND: qwerty get_text_xattr user.test
/d/backends/patchy1_new/file5.txt
not ok 29 Got "Binary file (standard input) matches" instead of "qwerty"
FAILED COMMAND: qwerty get_text_xattr user.test
/d/backends/patchy0/file5.txt
Failed 2/29 subtests

Fix:
Pass -a flag to grep

Change-Id: I69626fbf95a9ff756046363c5627cf98ea3f1df8
BUG: 1207829
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/11416
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>
2015-06-26 02:57:32 -07:00
Venky Shankar
6674e9e692 tests/bitrot: Scrub state change tests
Change-Id: Ibb4b503e7d723c86ac381ad3747b1198334bd6ad
BUG: 1231619
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/11290
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-21 05:04:26 -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
Xavier Hernandez
5513144feb posix: Do not update unmodified xattr in (f)xattrop
If a (f)xattrop is issued with a value that only contains 0's,
then we don't modify or create the extended attribute. This
is useful to avoid ctime modifications when the only purpose
of the xattrop was to get the current value.

Change-Id: Ia62494e9009962e683c8276783f671da17a8b03a
BUG: 1211123
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/10886
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-05-27 03:24:38 -07:00
Ravishankar N
b51ee5f8d1 tests: arbiter.t fix
Wait for AFR's children to be up in glustershd process before attempting heal.

Also, grep (version 2.21) is detecting statedump files as binary, causing tests
to succeed incorrectly. Hence adding the -a switch to force it to treat it as a
text file. Thanks to Vijay Bellur for identifying the issue
(http://lists.gnu.org/archive/html/bug-grep/2015-05/msg00000.html) and the
workaround.

Change-Id: Ie3d9591ffaf44baa0cd8c2baa327aed24378e3df
BUG: 1163543
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/10833
Tested-by: NetBSD Build System
Tested-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-05-24 02:20:19 -07:00
zhoushicheng
8f788528e6 test: Fix sparse file self heal test
This patch solves problems caused by XFS with speculative preallocation feature on :
Test EXPECT "1" has_holes $B0/${V0}0/big2bigger would fall when XFS has not freed the preallocated blocks.
It is caused by XFS speculative preallocation feature. The test would pass if this feature is disabled.
Speculative preallocation can speed up under linux 3.8(and later).
Otherwise, the test would pass by dropping cache manually to speed up speculative preallocation.

As in http://review.gluster.org/#/c/10411/, using "( cd $M0 ; umount $M0 )" to drop caches, which is
better than "echo 3 > /proc/sys/vm/drop_caches".

drop caches operation was added in test:
tests/basic/afr/sparse-file-self-heal.t

BUG: 1206461
Change-Id: Ie2c9d1b92fa8307c44498752fdd100eb86f9689c
Signed-off-by: zhoushicheng <madaozhou@gmail.com>
Reviewed-on: http://review.gluster.org/10253
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-05-19 08:34:25 -07:00
Atin Mukherjee
988e00f83c tests: fix bitrot spurious failures
Change-Id: I55bd62480b7ee38cf7b29aeba67b19b0c5bbe2fb
BUG: 1220016
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/10702
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2015-05-09 00:22:41 -07:00
Pranith Kumar K
7759748915 tests: Check aux umount is unmounted for quota tests
Change-Id: If57d08f3446755ea41f66ca258efcc8ea5a89063
BUG: 1217701
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/10480
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-05-04 01:23:28 -07:00
Kotresh HR
275f7244ff features/changelog: Consider only changelog on/off as changelog breakage
Earlier, both chagelog on/off and brick restart were considered
to be changelog breakage and treated as changelog not being
continuous. As a result, new HTIME.TSTAMP file was created on
both the above cases. Now the change is made such that only
on changelog enable/disable, the changelog is considered to be
discontinuous. New HTIME.TSTAMP file is not created on brick
restart, the changelogs files are appended to last HTIME.TSTAMP
file.

Treating changelog as continuous in above scenario is important
as changelog history API will fail otherwise. It can successfully
get changes between start and end timestamps only when changelog
is continuous (Changelogs in single HTIME.TSTAMP file are treated
as continuous). Without this change, changelog history API would
fail, and it would become necessary to fallback to other mechanisms
like xsync FSCrawl in case geo-rep to detect changes in this time
window. But Xsync FSCrawl would not be applicable to other
consumers like glusterfind.

Rationale:
1. In plain distributed volume, if brick goes down, no I/O can
   happen onto the brick. Hence changelog is intact with data
   on disk.
2. In distributed replicate volume, if brick goes down, since
   self-heal traffic is captured in changelog. Eventually,
   I/O happened whend brick down is captured in changelog.

Change-Id: I2eb66efe6ee9a9228fb1fcb38d6e7696b9559d5b
BUG: 1211327
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10222
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
2015-05-02 04:37:53 -07:00
Vijay Bellur
797e923da9 tests: Await for graph switch before testing open fop count
In performance/open-behind.t, a test for open fop reaching the brick is done by
switching off open-behind and performing a read operation. If the read operation
is performed before a graph switch, the read happens on the old graph and hence
open does not get accounted in the brick.

To overcome this EXPECT_WITHIN 10 seconds has now been added to ensure that a
graph switch has happened. The read operation happens subsequently after the
graph switch.

Cleaned up a "No volumes present" message from stderr while doing this.

Change-Id: I1e1c0d7e4bd2057520b4dd46157d18f30837b8c9
BUG: 1213066
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/10293
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
2015-04-29 07:03:11 -07:00
Vijaykumar Koppad
b5d7faa96b Geo-rep: Adding regression tests for geo-rep
This patch introduces upstream regression suit for geo-replication

    * Modifies cleanup (tests/include.rc) to remove everything but
      hook-scripts.

Prerequisites:
    * Passwordless SSH from root to root of current host.
    * Export /build/install/sbin and /build/install/bin to PATH
      variable for root user.

Change-Id: I433dd8bbb17edba9baaf516fe0dce3133ba39184
BUG: 1101111
Signed-off-by: Vijaykumar Koppad <vkoppad@redhat.com>
Signed-off-by: Ajeet Jha <ajha@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/7392
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-04-13 10:01:49 +00:00
Jeff Darcy
6d083f47e1 tests: fix volume_exists to be used from EXPECT_WITHIN
Fixes the spurious volume-snapshot-clone.t regression failures.  In
brief, the problem is that the script wasn't waiting for config commands
to complete, and would *sometimes* query the status of a volume while
that volume was still being deleted.

It turns out that "!" doesn't work properly from EXPECT_WITHIN, so there
was a choice between changing that or changing volume_exists.  This
seemed less risky.  Because of code duplication, two instances of the
function had to be changed, and the other caller (volume-snapshot.t) did
too.

Change-Id: I766d4dc7c5b11038ede8e45d9d1f29cd02a622a0
BUG: 1163543
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/10053
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-04-01 01:49:37 -07:00
Jeff Darcy
d3eacb0d83 tests: fix online_brick_count
It turns out that "pidof" is unreliable on some platforms (e.g. Fedora
21) because it will show spurious entries for processes using the same
inode under a different name.  Use "pgrep" instead because it's
name-based and doesn't get confused by glusterd/glusterfs being links
to glusterfsd.

Also changed bug-913555.t because it had the same mistake in its own
version of the same function.  Now it uses the common version.

Change-Id: I5d70edd5655faa5470e0f378b8c16a6adacbd4b4
BUG: 1163543
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/9948
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-30 23:41:29 -07:00
Pranith Kumar K
21cd43cfd6 libxlator: Change marker xattr handling interface
- Changed the implementation of marker xattr handling to take just a
  function which populates important data that is different from
  default 'gauge' values and subvolumes where the call needs to be
  wound.
- Removed duplicate code I found while reading the code and moved it to
  cluster_marker_unwind. Removed unused structure members.
- Changed dht/afr/stripe implementations to follow the new implementation
- Implemented marker xattr handling for ec.

Change-Id: Ib0c3626fe31eb7c8aae841eabb694945bf23abd4
BUG: 1200372
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9892
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-25 11:10:40 -07:00
Anuradha
d06692d1de cluster/afr : enable inspection & resolution of files in split-brain
Part 2/2 patch to enable users analyze and resolve
split-brain.

This patch enables :
1) Users to inspect the files in data and metadata split-brain.
2) Resolve the split-brain.
Both using a series of setfattr commands.

Consider a volume "test" with 2 bricks.

1) To inspect a file f1:
setfattr -n replica.split-brain-choice -v test-client-0 f1
        After the execution of this command, if no read_subvol
is found, reads will be served from test-client-0 (corresponding
to brick-0).

2) To resolve split-brain :
setfattr -n replica.split-brain-heal-finalize -v test-client-0 f1
        Execution of this command will lead to the resolution
of data and metadata split-brain with subvol mentioned in the
command (test-client-0 here) as the source and the rest as sink.

Change-Id: Ia20f3ee5abd3119e3d54fcc599f1e55ac65fd179
BUG: 1191396
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/9743
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-19 06:33:12 -07:00
Pranith Kumar K
3797caabb9 cluster/afr: Implementation of quorum-reads
Provide a way of disabling reads when quorum is not met.

Change-Id: Ic4f57c2b87a0b8514600759de3a7a47e217fe3b5
BUG: 1187885
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9543
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-05 21:56:20 -08:00
Mohammed Rafi KC
692dd7e83c cli: volume status for tcp,rdma type volume display only tcp port
For tcp,rdma type voumes, there will be two ports, one for tcp
and one for rdma. But volume status command only display tcp port.
By this change, adding an extra column for rdma port and changing
the port to tcp port.

Eg:

>gluster volume status pathy

>For tcp,rdma type volume

Status of volume: patchy
Gluster process                             TCP Port RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick brickname                             49152    49153      Y       14158

>For rdma type volume

Status of volume: patchy
Gluster process                             TCP Port RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick brickname                             0        49153      Y       14158

For tcp type volume

Status of volume: patchy
Gluster process                             TCP Port RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick brickname                             49152    0          Y       14158

>gluster volume status patchy detail

Status of volume: xcube2
------------------------------------------------------------------------------
Brick                : Brick brickname
TCP Port             : 49152
RDMA Port            : 49153
Online               : Y
Pid                  : 14158
File System          : ext4
Device               :
/dev/mapper/luks-2099dd4a-0050-4cae-ad7b-c6a0498c4e88
Mount Options        : rw,seclabel,relatime,data=ordered
Inode Size           : 256
Disk Space Free      : 31.1GB
Total Disk Space     : 47.9GB
Inode Count          : 3203072
Free Inodes          : 2926789

>gluster volume status xcube --xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr>(null)</opErrstr>
  <volStatus>
    <volumes>
      <volume>
        <volName>xcube</volName>
        <nodeCount>2</nodeCount>
        <node>
          <hostname>hostname</hostname>
          <path>/home/brick1</path>
          <peerid>2d7bcb95-3d26-4d4f-b3c6-e2ee01b71662</peerid>
          <status>1</status>
          <port>49152</port>
          <ports>
            <tcp>49152</tcp>
            <rdma>N/A</rdma>
          </ports>
          <pid>5657</pid>
        </node>
        <node>
          <hostname>NFS Server</hostname>
          <path>localhost</path>
          <peerid>2d7bcb95-3d26-4d4f-b3c6-e2ee01b71662</peerid>
          <status>1</status>
          <port>2049</port>
          <ports>
            <tcp>2049</tcp>
            <rdma>N/A</rdma>
          </ports>
          <pid>5665</pid>
        </node>
        <tasks/>
      </volume>
    </volumes>
  </volStatus>
</cliOutput>

Change-Id: I81aab226edbd400d29cd3f510af4f344dd99ba51
BUG: 1164079
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/9191
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2015-02-18 05:02:12 -08:00
Krutika Dhananjay
c78998c39f cluster/afr: When parent and entry read subvols are different, set entry->inode to NULL
That way a lookup would be forced on the entry, and its attributes will
always be selected from its read subvol.

Change-Id: Iaba25e2cd5f83e983fc8b1a1f48da3850808e6b8
BUG: 1179169
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/9477
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-02-02 12:07:08 -08:00
Anuradha
6413220059 afr : Change in heal info split-brain command
Implementation of heal info split-brain command with
glfs-heal.

Change-Id: I233eb790de6eb5468a4cbb12a1cef0f97db2a1d2
BUG: 1183019
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/9459
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>
2015-01-30 08:28:16 -08:00
Pranith Kumar K
7510d8edf4 mgmt/glusterd: Implement Volume heal enable/disable
For volumes with replicate, disperse xlators, self-heal daemon should do
healing. This patch provides enable/disable functionality for the xlators to be
part of self-heal-daemon. Replicate already had this functionality with
'gluster volume set cluster.self-heal-daemon on/off'. But this patch makes it
uniform for both types of volumes. Internally it still does 'volume set' based
on the volume type.

Change-Id: Ie0f3799b74c2afef9ac658ef3d50dce3e8072b29
BUG: 1177601
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9358
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-01-20 02:24:24 -08:00
Jeff Darcy
4d003c1b1b tests: let force_umount work on multiple items
Some scripts (e.g. features/weighted-rebalance.t) try to unmount
multiple mountpoints at once, using UMOUNT_LOOP.  This dutifully
passes the $* list through to force_umount, which (prior to this
fix) would only unmount $1 instead of the whole set.  This would
leave those devices mounted, which would not only be a resource
leak itself but would cause other cleanup actions to fail.

Change-Id: I2e3379c85792765025540f10be7cb37b8a4c1bcf
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/9386
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-01-18 22:07:16 -08:00
Pranith Kumar K
85fa19eef3 tests: Data self-heal test cases
Change-Id: I74d08797b791ea6649d9aba585996e9ec680e3f8
BUG: 1128721
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8538
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
2014-12-02 21:44:13 -08:00
Xavier Hernandez
7e76bd2430 ec: Add state dump support
Change-Id: I4504f3050674dde217e79af28cb4d2b5370fe2d5
BUG: 1148010
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8891
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-10-03 02:00:46 -07:00
Harshavardhana
fd500d4396 porting: Provide setfattr/getfattr implementation
- Use 'getfattr' properly avoid redundant options during xattr query
- Untabify certain parts of tests (remove tabs)
- Avoid backtick evaluation for certain values to make code more portable.
- Use awk on FreeBSD/Darwin, since 'wc' implementation is broken and adds
  spurious spaces in its output.

Change-Id: I7dcc0b70874e43b4cda8c306ed18a31b7a3f990a
BUG: 1131713
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8520
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
2014-09-05 10:04:20 -07:00
Emmanuel Dreyfus
ba0f31b2a5 Regression test portability: stat
Linux uses stat -c, stat --printf= or stat --printf
NetBSD uses stat -f with different format strings. This change set
changes all stat usage to stat -c and introduce a shell stat()
fonction to perform the format string translation.

BUG: 764655
Change-Id: I024fca7c1b736b053f5888cbf21da0a72489ef63
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8424
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-08-18 01:09:39 -07:00
Harshavardhana
2ec6ea43f2 build: make GLUSTERD_WORKDIR rely on localstatedir
- Break-way from '/var/lib/glusterd' hard-coded previously,
  instead rely on 'configure' value from 'localstatedir'
- Provide 's/lib/db' as default working directory for gluster
  management daemon for BSD and Darwin based installations
- loff_t is really off_t on Darwin
- fix-off the warnings generated by clang on FreeBSD/Darwin
- Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all
  platforms.
- Define proper environment for running tests, define correct PATH
  and LD_LIBRARY_PATH when running tests, so that the desired version
  of glusterfs is used, regardless where it is installed.
  (Thanks to manu@netbsd.org for this additional work)

Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7
BUG: 1111774
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8246
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-08-07 01:17:29 -07:00
Emmanuel Dreyfus
a95444c95c Regression test portability: ps
ps aux is truncated to the terminal width on NetBSD, Use ps auxww to
avoid that

BUG: 764655
Change-Id: I28a2fc23e2823dd6524a72da30111b86fc4bfa7b
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8281
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-07-28 17:41:42 -07:00
Krutika Dhananjay
e93e7d3050 cluster/stripe: Fix EINVAL errors on quota enabled volumes
Write operations on directories with quota enabled used to fail with
EINVAL on stripe volumes. This was due to assert failure in
stripe_lookup(), meant to ensure loc->path is not NULL. However,
in nameless lookup (in this particular case triggered by quotad, which
has stripe xlator in its graph), loc->path can be legitimately NULL.

The fix involves removing this check in stripe_lookup().

Change-Id: Ibbd4f68763fdd8a85f29da78b3937cef1ee4fd1e
BUG: 1100050
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8145
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-26 09:58:31 -07:00
Pranith Kumar K
616b0aa44f tests: Provide force_umount with 5 retries
Change-Id: I2b5784c48eedcccb17690de438addd29075926bd
BUG: 1092850
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8104
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-18 23:45:38 -07:00