autobuild v6.0-14
Resolves: bz#1719171 bz#1728673 bz#1731896 bz#1732443 bz#1733970 Resolves: bz#1745107 bz#1746027 bz#1748688 bz#1750241 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
This commit is contained in:
parent
a297aa883e
commit
4db34b7f8e
@ -0,0 +1,43 @@
|
||||
From 49cd9ef7487ba88796315b897823837a9cbd535e Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Wed, 28 Aug 2019 09:05:20 +0530
|
||||
Subject: [PATCH 285/297] glusterd: glusterd service is getting timed out on
|
||||
scaled setup
|
||||
|
||||
Problem: On a three node cluster with 2000 replica volumes systemctl is getting
|
||||
timed out for glusted service.
|
||||
|
||||
Solution: Configure TimeoutSec 300 to wait for glusterd startup.
|
||||
|
||||
> Change-Id: Idb3f3f3e56e6216a0ebd754cbb9e8e37ce9e636d
|
||||
> Fixes: bz#1746228
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> (Cherry picked from commit c90dc63ec9eee0f43ba8e489876fdf8b8810bbdc)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23316/)
|
||||
|
||||
Change-Id: Idb3f3f3e56e6216a0ebd754cbb9e8e37ce9e636d
|
||||
BUG: 1746027
|
||||
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/179806
|
||||
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/systemd/glusterd.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/extras/systemd/glusterd.service.in b/extras/systemd/glusterd.service.in
|
||||
index c33351c..f604160 100644
|
||||
--- a/extras/systemd/glusterd.service.in
|
||||
+++ b/extras/systemd/glusterd.service.in
|
||||
@@ -13,6 +13,7 @@ Environment="LOG_LEVEL=INFO"
|
||||
EnvironmentFile=-@sysconfdir@/sysconfig/glusterd
|
||||
ExecStart=@prefix@/sbin/glusterd -p @localstatedir@/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS
|
||||
KillMode=process
|
||||
+TimeoutSec=300
|
||||
SuccessExitStatus=15
|
||||
|
||||
[Install]
|
||||
--
|
||||
1.8.3.1
|
||||
|
162
0286-glusterfs.spec.in-added-script-files-for-machine-com.patch
Normal file
162
0286-glusterfs.spec.in-added-script-files-for-machine-com.patch
Normal file
@ -0,0 +1,162 @@
|
||||
From 2a905a8ae6b4737e84543ad76b55f3346fa0f32c Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Tue, 27 Aug 2019 14:12:31 +0530
|
||||
Subject: [PATCH 286/297] glusterfs.spec.in: added script files for machine /
|
||||
component stats
|
||||
|
||||
Have added the file (extras/identify-hangs.sh) to the code base.
|
||||
And included the following to be packaged:
|
||||
|
||||
Quota Accounting issue:
|
||||
extras/quota/xattr_analysis.py (made available only on server)
|
||||
extras/quota/quota_fsck.py (made available only on server)
|
||||
extras/quota/log_accounting.sh
|
||||
|
||||
Debugging Statedumps:
|
||||
extras/identify-hangs.sh
|
||||
|
||||
Performance:
|
||||
extras/collect-system-stats.sh
|
||||
|
||||
Note: rest of the files were already included.
|
||||
|
||||
Label: DOWNSTREAM ONLY.
|
||||
|
||||
Change-Id: I2efb959865c3f381166c6a25c6eef613d13dd5ee
|
||||
fixes: bz#1719171
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/179515
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
extras/Makefile.am | 9 +++++++-
|
||||
extras/identify-hangs.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
glusterfs.spec.in | 8 ++++++++
|
||||
3 files changed, 69 insertions(+), 1 deletion(-)
|
||||
create mode 100644 extras/identify-hangs.sh
|
||||
|
||||
diff --git a/extras/Makefile.am b/extras/Makefile.am
|
||||
index 983f014..8cbfda1 100644
|
||||
--- a/extras/Makefile.am
|
||||
+++ b/extras/Makefile.am
|
||||
@@ -30,9 +30,14 @@ endif
|
||||
|
||||
scriptsdir = $(datadir)/glusterfs/scripts
|
||||
scripts_SCRIPTS = thin-arbiter/setup-thin-arbiter.sh
|
||||
+scripts_SCRIPTS += quota/log_accounting.sh
|
||||
+scripts_SCRIPTS += collect-system-stats.sh
|
||||
+scripts_SCRIPTS += identify-hangs.sh
|
||||
if WITH_SERVER
|
||||
scripts_SCRIPTS += post-upgrade-script-for-quota.sh \
|
||||
pre-upgrade-script-for-quota.sh stop-all-gluster-processes.sh
|
||||
+scripts_SCRIPTS += quota/quota_fsck.py
|
||||
+scripts_SCRIPTS += quota/xattr_analysis.py
|
||||
if USE_SYSTEMD
|
||||
scripts_SCRIPTS += control-cpu-load.sh
|
||||
scripts_SCRIPTS += control-mem.sh
|
||||
@@ -50,7 +55,9 @@ EXTRA_DIST = glusterfs-logrotate gluster-rsyslog-7.2.conf gluster-rsyslog-5.8.co
|
||||
command-completion/Makefile command-completion/README \
|
||||
stop-all-gluster-processes.sh clang-checker.sh mount-shared-storage.sh \
|
||||
control-cpu-load.sh control-mem.sh group-distributed-virt \
|
||||
- thin-arbiter/thin-arbiter.vol thin-arbiter/setup-thin-arbiter.sh
|
||||
+ thin-arbiter/thin-arbiter.vol thin-arbiter/setup-thin-arbiter.sh \
|
||||
+ quota/xattr_analysis.py quota/quota_fsck.py quota/log_accounting.sh \
|
||||
+ collect-system-stats.sh identify-hangs.sh
|
||||
|
||||
if WITH_SERVER
|
||||
install-data-local:
|
||||
diff --git a/extras/identify-hangs.sh b/extras/identify-hangs.sh
|
||||
new file mode 100644
|
||||
index 0000000..ebc6bf1
|
||||
--- /dev/null
|
||||
+++ b/extras/identify-hangs.sh
|
||||
@@ -0,0 +1,53 @@
|
||||
+#!/bin/bash
|
||||
+function get_statedump_fnames_without_timestamps
|
||||
+{
|
||||
+ ls | grep -E "[.]dump[.][0-9][0-9]*" | cut -f1-3 -d'.' | sort -u
|
||||
+}
|
||||
+
|
||||
+function get_non_uniq_fields
|
||||
+{
|
||||
+ local statedump_fname_prefix=$1
|
||||
+ print_stack_lkowner_unique_in_one_line "$statedump_fname_prefix" | sort | uniq -c | grep -vE "^\s*1 " | awk '{$1="repeats="$1; print $0}'
|
||||
+}
|
||||
+
|
||||
+function print_stack_lkowner_unique_in_one_line
|
||||
+{
|
||||
+ local statedump_fname_prefix=$1
|
||||
+ sed -e '/./{H;$!d;}' -e 'x;/unique=/!d;/stack=/!d;/lk-owner=/!d;/pid=/!d;' "${statedump_fname_prefix}"* | grep -E "(stack|lk-owner|unique|pid)=" | paste -d " " - - - -
|
||||
+}
|
||||
+
|
||||
+function get_stacks_that_appear_in_multiple_statedumps
|
||||
+{
|
||||
+ #If a stack with same 'unique/lk-owner/stack' appears in multiple statedumps
|
||||
+ #print the stack
|
||||
+ local statedump_fname_prefix=$1
|
||||
+ while read -r non_uniq_stack;
|
||||
+ do
|
||||
+ if [ -z "$printed" ];
|
||||
+ then
|
||||
+ printed="1"
|
||||
+ fi
|
||||
+ echo "$statedump_fname_prefix" "$non_uniq_stack"
|
||||
+ done < <(get_non_uniq_fields "$statedump_fname_prefix")
|
||||
+}
|
||||
+
|
||||
+statedumpdir=${1}
|
||||
+if [ -z "$statedumpdir" ];
|
||||
+then
|
||||
+ echo "Usage: $0 <statedump-dir>"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+if [ ! -d "$statedumpdir" ];
|
||||
+then
|
||||
+ echo "$statedumpdir: Is not a directory"
|
||||
+ echo "Usage: $0 <statedump-dir>"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+cd "$statedumpdir" || exit 1
|
||||
+for statedump_fname_prefix in $(get_statedump_fnames_without_timestamps);
|
||||
+do
|
||||
+ get_stacks_that_appear_in_multiple_statedumps "$statedump_fname_prefix"
|
||||
+done | column -t
|
||||
+echo "NOTE: stacks with lk-owner=\"\"/lk-owner=0000000000000000/unique=0 may not be hung frames and need further inspection" >&2
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index 00603ec..3c2e2dc 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -1107,6 +1107,9 @@ exit 0
|
||||
%{_datadir}/glusterfs/scripts/post-upgrade-script-for-quota.sh
|
||||
%{_datadir}/glusterfs/scripts/pre-upgrade-script-for-quota.sh
|
||||
%endif
|
||||
+%{_datadir}/glusterfs/scripts/identify-hangs.sh
|
||||
+%{_datadir}/glusterfs/scripts/collect-system-stats.sh
|
||||
+%{_datadir}/glusterfs/scripts/log_accounting.sh
|
||||
# xlators that are needed on the client- and on the server-side
|
||||
%dir %{_libdir}/glusterfs
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}
|
||||
@@ -1352,6 +1355,8 @@ exit 0
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%files server
|
||||
%doc extras/clear_xattrs.sh
|
||||
+%{_datadir}/glusterfs/scripts/xattr_analysis.py*
|
||||
+%{_datadir}/glusterfs/scripts/quota_fsck.py*
|
||||
# sysconf
|
||||
%config(noreplace) %{_sysconfdir}/glusterfs
|
||||
%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
@@ -1942,6 +1947,9 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
+* Tue Aug 27 2019 Hari Gowtham <hgowtham@redhat.com>
|
||||
+- Added scripts to collect machine stats and component stats (#1719171)
|
||||
+
|
||||
* Tue Jun 18 2019 Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
- build glusterfs-ganesha for rhel 7 and above (#1720551)
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
372
0287-cluster-ec-Fail-fsync-flush-for-files-on-update-size.patch
Normal file
372
0287-cluster-ec-Fail-fsync-flush-for-files-on-update-size.patch
Normal file
@ -0,0 +1,372 @@
|
||||
From 546f412c155dd5aca2b3cd4202f80c9977b215dc Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Wed, 4 Sep 2019 12:06:34 +0530
|
||||
Subject: [PATCH 287/297] cluster/ec: Fail fsync/flush for files on update
|
||||
size/version failure
|
||||
|
||||
Problem:
|
||||
If update size/version is not successful on the file, updates on the
|
||||
same stripe could lead to data corruptions if the earlier un-aligned
|
||||
write is not successful on all the bricks. Application won't have
|
||||
any knowledge of this because update size/version happens in the
|
||||
background.
|
||||
|
||||
Fix:
|
||||
Fail fsync/flush on fds that are opened before update-size-version
|
||||
went bad.
|
||||
|
||||
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23355
|
||||
fixes: bz#1745107
|
||||
Change-Id: I9d323eddcda703bd27d55f340c4079d76e06e492
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/180672
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
tests/basic/ec/ec-badfd.c | 124 +++++++++++++++++++++++++++++++++++
|
||||
tests/basic/ec/ec-badfd.t | 26 ++++++++
|
||||
xlators/cluster/ec/src/ec-common.c | 23 +++++++
|
||||
xlators/cluster/ec/src/ec-generic.c | 47 +++++++++++++
|
||||
xlators/cluster/ec/src/ec-helpers.c | 7 ++
|
||||
xlators/cluster/ec/src/ec-messages.h | 2 +-
|
||||
xlators/cluster/ec/src/ec-types.h | 2 +
|
||||
7 files changed, 230 insertions(+), 1 deletion(-)
|
||||
create mode 100644 tests/basic/ec/ec-badfd.c
|
||||
create mode 100755 tests/basic/ec/ec-badfd.t
|
||||
|
||||
diff --git a/tests/basic/ec/ec-badfd.c b/tests/basic/ec/ec-badfd.c
|
||||
new file mode 100644
|
||||
index 0000000..8be23c1
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ec/ec-badfd.c
|
||||
@@ -0,0 +1,124 @@
|
||||
+#include <stdio.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <unistd.h>
|
||||
+#include <time.h>
|
||||
+#include <limits.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <errno.h>
|
||||
+#include <glusterfs/api/glfs.h>
|
||||
+#include <glusterfs/api/glfs-handles.h>
|
||||
+
|
||||
+int
|
||||
+fill_iov(struct iovec *iov, char fillchar, int count)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ iov->iov_base = malloc(count + 1);
|
||||
+ if (iov->iov_base == NULL) {
|
||||
+ return ret;
|
||||
+ } else {
|
||||
+ iov->iov_len = count;
|
||||
+ ret = 0;
|
||||
+ }
|
||||
+ memset(iov->iov_base, fillchar, count);
|
||||
+ memset(iov->iov_base + count, '\0', 1);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+write_sync(glfs_t *fs, glfs_fd_t *glfd, int char_count)
|
||||
+{
|
||||
+ ssize_t ret = -1;
|
||||
+ int flags = O_RDWR;
|
||||
+ struct iovec iov = {0};
|
||||
+
|
||||
+ ret = fill_iov(&iov, 'a', char_count);
|
||||
+ if (ret) {
|
||||
+ fprintf(stderr, "failed to create iov");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = glfs_pwritev(glfd, &iov, 1, 0, flags);
|
||||
+out:
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, "glfs_pwritev failed, %d", errno);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main(int argc, char *argv[])
|
||||
+{
|
||||
+ glfs_t *fs = NULL;
|
||||
+ glfs_fd_t *fd = NULL;
|
||||
+ int ret = 1;
|
||||
+ char volume_cmd[4096] = {0};
|
||||
+
|
||||
+ if (argc != 4) {
|
||||
+ fprintf(stderr, "Syntax: %s <host> <volname> <file>\n", argv[0]);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ fs = glfs_new(argv[2]);
|
||||
+ if (!fs) {
|
||||
+ fprintf(stderr, "glfs_new: returned NULL\n");
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ ret = glfs_set_volfile_server(fs, "tcp", argv[1], 24007);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, "glfs_set_volfile_server: returned %d\n", ret);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ ret = glfs_set_logging(fs, "/tmp/ec-badfd.log", 7);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, "glfs_set_logging: returned %d\n", ret);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ ret = glfs_init(fs);
|
||||
+ if (ret != 0) {
|
||||
+ fprintf(stderr, "glfs_init: returned %d\n", ret);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ fd = glfs_open(fs, argv[3], O_RDWR);
|
||||
+ if (fd == NULL) {
|
||||
+ fprintf(stderr, "glfs_open: returned NULL\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = write_sync(fs, fd, 16);
|
||||
+ if (ret < 0) {
|
||||
+ fprintf(stderr, "write_sync failed\n");
|
||||
+ }
|
||||
+
|
||||
+ snprintf(volume_cmd, sizeof(volume_cmd),
|
||||
+ "gluster --mode=script volume stop %s", argv[2]);
|
||||
+ /*Stop the volume so that update-size-version fails*/
|
||||
+ system(volume_cmd);
|
||||
+ sleep(8); /* 3 seconds more than eager-lock-timeout*/
|
||||
+ snprintf(volume_cmd, sizeof(volume_cmd),
|
||||
+ "gluster --mode=script volume start %s", argv[2]);
|
||||
+ system(volume_cmd);
|
||||
+ sleep(8); /*wait for bricks to come up*/
|
||||
+ ret = glfs_fsync(fd, NULL, NULL);
|
||||
+ if (ret == 0) {
|
||||
+ fprintf(stderr, "fsync succeeded on a BADFD\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ ret = glfs_close(fd);
|
||||
+ if (ret == 0) {
|
||||
+ fprintf(stderr, "flush succeeded on a BADFD\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ ret = 0;
|
||||
+
|
||||
+out:
|
||||
+ unlink("/tmp/ec-badfd.log");
|
||||
+ glfs_fini(fs);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/tests/basic/ec/ec-badfd.t b/tests/basic/ec/ec-badfd.t
|
||||
new file mode 100755
|
||||
index 0000000..56feb47
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ec/ec-badfd.t
|
||||
@@ -0,0 +1,26 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+
|
||||
+cleanup;
|
||||
+
|
||||
+TEST glusterd
|
||||
+TEST pidof glusterd
|
||||
+
|
||||
+TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{1..6}
|
||||
+TEST $CLI volume set $V0 performance.write-behind off
|
||||
+TEST $CLI volume set $V0 disperse.eager-lock-timeout 5
|
||||
+
|
||||
+TEST $CLI volume start $V0
|
||||
+EXPECT 'Started' volinfo_field $V0 'Status'
|
||||
+
|
||||
+TEST $GFS -s $H0 --volfile-id $V0 $M0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+TEST touch $M0/file
|
||||
+
|
||||
+TEST build_tester $(dirname $0)/ec-badfd.c -lgfapi -Wall -O2
|
||||
+TEST $(dirname $0)/ec-badfd $H0 $V0 /file
|
||||
+cleanup_tester $(dirname ${0})/ec-badfd
|
||||
+
|
||||
+cleanup;
|
||||
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
|
||||
index 5fb4610..92d4e5d 100644
|
||||
--- a/xlators/cluster/ec/src/ec-common.c
|
||||
+++ b/xlators/cluster/ec/src/ec-common.c
|
||||
@@ -2255,6 +2255,23 @@ ec_unlock_lock(ec_lock_link_t *link)
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
+ec_inode_bad_inc(inode_t *inode, xlator_t *xl)
|
||||
+{
|
||||
+ ec_inode_t *ctx = NULL;
|
||||
+
|
||||
+ LOCK(&inode->lock);
|
||||
+ {
|
||||
+ ctx = __ec_inode_get(inode, xl);
|
||||
+ if (ctx == NULL) {
|
||||
+ goto unlock;
|
||||
+ }
|
||||
+ ctx->bad_version++;
|
||||
+ }
|
||||
+unlock:
|
||||
+ UNLOCK(&inode->lock);
|
||||
+}
|
||||
+
|
||||
int32_t
|
||||
ec_update_size_version_done(call_frame_t *frame, void *cookie, xlator_t *this,
|
||||
int32_t op_ret, int32_t op_errno, dict_t *xattr,
|
||||
@@ -2270,6 +2287,12 @@ ec_update_size_version_done(call_frame_t *frame, void *cookie, xlator_t *this,
|
||||
ctx = lock->ctx;
|
||||
|
||||
if (op_ret < 0) {
|
||||
+ if (link->lock->fd == NULL) {
|
||||
+ ec_inode_bad_inc(link->lock->loc.inode, this);
|
||||
+ } else {
|
||||
+ ec_inode_bad_inc(link->lock->fd->inode, this);
|
||||
+ }
|
||||
+
|
||||
gf_msg(fop->xl->name, fop_log_level(fop->id, op_errno), op_errno,
|
||||
EC_MSG_SIZE_VERS_UPDATE_FAIL,
|
||||
"Failed to update version and size. %s", ec_msg_str(fop));
|
||||
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c
|
||||
index acc16b5..b019050 100644
|
||||
--- a/xlators/cluster/ec/src/ec-generic.c
|
||||
+++ b/xlators/cluster/ec/src/ec-generic.c
|
||||
@@ -150,6 +150,37 @@ ec_manager_flush(ec_fop_data_t *fop, int32_t state)
|
||||
}
|
||||
}
|
||||
|
||||
+static int32_t
|
||||
+ec_validate_fd(fd_t *fd, xlator_t *xl)
|
||||
+{
|
||||
+ uint64_t iversion = 0;
|
||||
+ uint64_t fversion = 0;
|
||||
+ ec_inode_t *inode_ctx = NULL;
|
||||
+ ec_fd_t *fd_ctx = NULL;
|
||||
+
|
||||
+ LOCK(&fd->lock);
|
||||
+ {
|
||||
+ fd_ctx = __ec_fd_get(fd, xl);
|
||||
+ if (fd_ctx) {
|
||||
+ fversion = fd_ctx->bad_version;
|
||||
+ }
|
||||
+ }
|
||||
+ UNLOCK(&fd->lock);
|
||||
+
|
||||
+ LOCK(&fd->inode->lock);
|
||||
+ {
|
||||
+ inode_ctx = __ec_inode_get(fd->inode, xl);
|
||||
+ if (inode_ctx) {
|
||||
+ iversion = inode_ctx->bad_version;
|
||||
+ }
|
||||
+ }
|
||||
+ UNLOCK(&fd->inode->lock);
|
||||
+ if (fversion < iversion) {
|
||||
+ return EBADF;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
void
|
||||
ec_flush(call_frame_t *frame, xlator_t *this, uintptr_t target,
|
||||
uint32_t fop_flags, fop_flush_cbk_t func, void *data, fd_t *fd,
|
||||
@@ -165,6 +196,14 @@ ec_flush(call_frame_t *frame, xlator_t *this, uintptr_t target,
|
||||
GF_VALIDATE_OR_GOTO(this->name, frame, out);
|
||||
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
|
||||
|
||||
+ error = ec_validate_fd(fd, this);
|
||||
+ if (error) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
+ "Failing %s on %s", gf_fop_list[GF_FOP_FLUSH],
|
||||
+ fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
fop = ec_fop_data_allocate(frame, this, GF_FOP_FLUSH, 0, target, fop_flags,
|
||||
ec_wind_flush, ec_manager_flush, callback, data);
|
||||
if (fop == NULL) {
|
||||
@@ -381,6 +420,14 @@ ec_fsync(call_frame_t *frame, xlator_t *this, uintptr_t target,
|
||||
GF_VALIDATE_OR_GOTO(this->name, frame, out);
|
||||
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
|
||||
|
||||
+ error = ec_validate_fd(fd, this);
|
||||
+ if (error) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
+ "Failing %s on %s", gf_fop_list[GF_FOP_FSYNC],
|
||||
+ fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNC, 0, target, fop_flags,
|
||||
ec_wind_fsync, ec_manager_fsync, callback, data);
|
||||
if (fop == NULL) {
|
||||
diff --git a/xlators/cluster/ec/src/ec-helpers.c b/xlators/cluster/ec/src/ec-helpers.c
|
||||
index 43f6e3b..baac001 100644
|
||||
--- a/xlators/cluster/ec/src/ec-helpers.c
|
||||
+++ b/xlators/cluster/ec/src/ec-helpers.c
|
||||
@@ -753,6 +753,7 @@ __ec_fd_get(fd_t *fd, xlator_t *xl)
|
||||
{
|
||||
int i = 0;
|
||||
ec_fd_t *ctx = NULL;
|
||||
+ ec_inode_t *ictx = NULL;
|
||||
uint64_t value = 0;
|
||||
ec_t *ec = xl->private;
|
||||
|
||||
@@ -775,6 +776,12 @@ __ec_fd_get(fd_t *fd, xlator_t *xl)
|
||||
GF_FREE(ctx);
|
||||
return NULL;
|
||||
}
|
||||
+ /* Only refering bad-version so no need for lock
|
||||
+ * */
|
||||
+ ictx = __ec_inode_get(fd->inode, xl);
|
||||
+ if (ictx) {
|
||||
+ ctx->bad_version = ictx->bad_version;
|
||||
+ }
|
||||
}
|
||||
} else {
|
||||
ctx = (ec_fd_t *)(uintptr_t)value;
|
||||
diff --git a/xlators/cluster/ec/src/ec-messages.h b/xlators/cluster/ec/src/ec-messages.h
|
||||
index 7c28808..be86b37 100644
|
||||
--- a/xlators/cluster/ec/src/ec-messages.h
|
||||
+++ b/xlators/cluster/ec/src/ec-messages.h
|
||||
@@ -55,6 +55,6 @@ GLFS_MSGID(EC, EC_MSG_INVALID_CONFIG, EC_MSG_HEAL_FAIL,
|
||||
EC_MSG_CONFIG_XATTR_INVALID, EC_MSG_EXTENSION, EC_MSG_EXTENSION_NONE,
|
||||
EC_MSG_EXTENSION_UNKNOWN, EC_MSG_EXTENSION_UNSUPPORTED,
|
||||
EC_MSG_EXTENSION_FAILED, EC_MSG_NO_GF, EC_MSG_MATRIX_FAILED,
|
||||
- EC_MSG_DYN_CREATE_FAILED, EC_MSG_DYN_CODEGEN_FAILED);
|
||||
+ EC_MSG_DYN_CREATE_FAILED, EC_MSG_DYN_CODEGEN_FAILED, EC_MSG_FD_BAD);
|
||||
|
||||
#endif /* !_EC_MESSAGES_H_ */
|
||||
diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h
|
||||
index 1c295c0..f27f2ec 100644
|
||||
--- a/xlators/cluster/ec/src/ec-types.h
|
||||
+++ b/xlators/cluster/ec/src/ec-types.h
|
||||
@@ -150,6 +150,7 @@ struct _ec_fd {
|
||||
loc_t loc;
|
||||
uintptr_t open;
|
||||
int32_t flags;
|
||||
+ uint64_t bad_version;
|
||||
ec_fd_status_t fd_status[0];
|
||||
};
|
||||
|
||||
@@ -180,6 +181,7 @@ struct _ec_inode {
|
||||
uint64_t dirty[2];
|
||||
struct list_head heal;
|
||||
ec_stripe_list_t stripe_cache;
|
||||
+ uint64_t bad_version;
|
||||
};
|
||||
|
||||
typedef int32_t (*fop_heal_cbk_t)(call_frame_t *, void *, xlator_t *, int32_t,
|
||||
--
|
||||
1.8.3.1
|
||||
|
77
0288-cluster-ec-Fix-coverity-issues.patch
Normal file
77
0288-cluster-ec-Fix-coverity-issues.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From ccf7775760dd923e21341438725946737eb8d8af Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Sat, 7 Sep 2019 20:18:01 +0530
|
||||
Subject: [PATCH 288/297] cluster/ec: Fix coverity issues
|
||||
|
||||
Fixed the following coverity issue in both flush/fsync
|
||||
>>> CID 1404964: Null pointer dereferences (REVERSE_INULL)
|
||||
>>> Null-checking "fd" suggests that it may be null, but it has already
|
||||
been dereferenced on all paths leading to the check.
|
||||
>>> if (fd != NULL) {
|
||||
>>> fop->fd = fd_ref(fd);
|
||||
>>> if (fop->fd == NULL) {
|
||||
>>> gf_msg(this->name, GF_LOG_ERROR, 0,
|
||||
>>> "Failed to reference a "
|
||||
>>> "file descriptor.");
|
||||
|
||||
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23382
|
||||
fixes: bz#1745107
|
||||
Change-Id: I19c05d585e23f8fbfbc195d1f3775ec528eed671
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/180673
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/cluster/ec/src/ec-generic.c | 28 ++++++++++++++++------------
|
||||
1 file changed, 16 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c
|
||||
index b019050..192bb02 100644
|
||||
--- a/xlators/cluster/ec/src/ec-generic.c
|
||||
+++ b/xlators/cluster/ec/src/ec-generic.c
|
||||
@@ -196,12 +196,14 @@ ec_flush(call_frame_t *frame, xlator_t *this, uintptr_t target,
|
||||
GF_VALIDATE_OR_GOTO(this->name, frame, out);
|
||||
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
|
||||
|
||||
- error = ec_validate_fd(fd, this);
|
||||
- if (error) {
|
||||
- gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
- "Failing %s on %s", gf_fop_list[GF_FOP_FLUSH],
|
||||
- fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
- goto out;
|
||||
+ if (fd) {
|
||||
+ error = ec_validate_fd(fd, this);
|
||||
+ if (error) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
+ "Failing %s on %s", gf_fop_list[GF_FOP_FLUSH],
|
||||
+ fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
fop = ec_fop_data_allocate(frame, this, GF_FOP_FLUSH, 0, target, fop_flags,
|
||||
@@ -420,12 +422,14 @@ ec_fsync(call_frame_t *frame, xlator_t *this, uintptr_t target,
|
||||
GF_VALIDATE_OR_GOTO(this->name, frame, out);
|
||||
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
|
||||
|
||||
- error = ec_validate_fd(fd, this);
|
||||
- if (error) {
|
||||
- gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
- "Failing %s on %s", gf_fop_list[GF_FOP_FSYNC],
|
||||
- fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
- goto out;
|
||||
+ if (fd) {
|
||||
+ error = ec_validate_fd(fd, this);
|
||||
+ if (error) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, EBADF, EC_MSG_FD_BAD,
|
||||
+ "Failing %s on %s", gf_fop_list[GF_FOP_FSYNC],
|
||||
+ fd->inode ? uuid_utoa(fd->inode->gfid) : "");
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
fop = ec_fop_data_allocate(frame, this, GF_FOP_FSYNC, 0, target, fop_flags,
|
||||
--
|
||||
1.8.3.1
|
||||
|
721
0289-cluster-ec-quorum-count-implementation.patch
Normal file
721
0289-cluster-ec-quorum-count-implementation.patch
Normal file
@ -0,0 +1,721 @@
|
||||
From 0d54bb417e982a100ceefb5eab2a61a17e840f39 Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Thu, 5 Sep 2019 16:12:39 +0530
|
||||
Subject: [PATCH 289/297] cluster/ec: quorum-count implementation
|
||||
|
||||
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23366
|
||||
upstream-issue: #721
|
||||
fixes: bz#1748688
|
||||
Change-Id: I5333540e3c635ccf441cf1f4696e4c8986e38ea8
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/180674
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
libglusterfs/src/glusterfs/globals.h | 4 +-
|
||||
tests/basic/ec/ec-quorum-count-partial-failure.t | 50 +++++++
|
||||
tests/basic/ec/ec-quorum-count.t | 165 +++++++++++++++++++++++
|
||||
tests/ec.rc | 9 ++
|
||||
xlators/cluster/ec/src/ec-common.c | 13 ++
|
||||
xlators/cluster/ec/src/ec-common.h | 24 ++++
|
||||
xlators/cluster/ec/src/ec-dir-write.c | 57 ++++----
|
||||
xlators/cluster/ec/src/ec-inode-write.c | 61 ++++-----
|
||||
xlators/cluster/ec/src/ec-types.h | 1 +
|
||||
xlators/cluster/ec/src/ec.c | 13 ++
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 46 +++++++
|
||||
11 files changed, 383 insertions(+), 60 deletions(-)
|
||||
create mode 100755 tests/basic/ec/ec-quorum-count-partial-failure.t
|
||||
create mode 100644 tests/basic/ec/ec-quorum-count.t
|
||||
|
||||
diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h
|
||||
index 55476f6..bdc8b3d 100644
|
||||
--- a/libglusterfs/src/glusterfs/globals.h
|
||||
+++ b/libglusterfs/src/glusterfs/globals.h
|
||||
@@ -50,7 +50,7 @@
|
||||
1 /* MIN is the fresh start op-version, mostly \
|
||||
should not change */
|
||||
#define GD_OP_VERSION_MAX \
|
||||
- GD_OP_VERSION_7_0 /* MAX VERSION is the maximum \
|
||||
+ GD_OP_VERSION_8_0 /* MAX VERSION is the maximum \
|
||||
count in VME table, should \
|
||||
keep changing with \
|
||||
introduction of newer \
|
||||
@@ -136,6 +136,8 @@
|
||||
|
||||
#define GD_OP_VERSION_7_0 70000 /* Op-version for GlusterFS 7.0 */
|
||||
|
||||
+#define GD_OP_VERSION_8_0 80000 /* Op-version for GlusterFS 8.0 */
|
||||
+
|
||||
#include "glusterfs/xlator.h"
|
||||
#include "glusterfs/options.h"
|
||||
|
||||
diff --git a/tests/basic/ec/ec-quorum-count-partial-failure.t b/tests/basic/ec/ec-quorum-count-partial-failure.t
|
||||
new file mode 100755
|
||||
index 0000000..79f5825
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ec/ec-quorum-count-partial-failure.t
|
||||
@@ -0,0 +1,50 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+
|
||||
+#This test checks that partial failure of fop results in main fop failure only
|
||||
+cleanup;
|
||||
+
|
||||
+TEST glusterd
|
||||
+TEST pidof glusterd
|
||||
+TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5}
|
||||
+TEST $CLI volume create $V1 $H0:$B0/${V1}{0..5}
|
||||
+TEST $CLI volume set $V0 performance.flush-behind off
|
||||
+TEST $CLI volume start $V0
|
||||
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=/$V0 $M0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+
|
||||
+TEST dd if=/dev/urandom of=$M0/a bs=12347 count=1
|
||||
+TEST dd if=/dev/urandom of=$M0/b bs=12347 count=1
|
||||
+TEST cp $M0/b $M0/c
|
||||
+TEST fallocate -p -l 101 $M0/c
|
||||
+TEST $CLI volume stop $V0
|
||||
+TEST $CLI volume set $V0 debug.delay-gen posix;
|
||||
+TEST $CLI volume set $V0 delay-gen.delay-duration 10000000;
|
||||
+TEST $CLI volume set $V0 delay-gen.enable WRITE;
|
||||
+TEST $CLI volume set $V0 delay-gen.delay-percentage 100
|
||||
+TEST $CLI volume set $V0 disperse.quorum-count 6
|
||||
+TEST $CLI volume start $V0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+cksum=$(dd if=$M0/a bs=12345 count=1 | md5sum | awk '{print $1}')
|
||||
+truncate -s 12345 $M0/a & #While write is waiting for 5 seconds, introduce failure
|
||||
+fallocate -p -l 101 $M0/b &
|
||||
+sleep 1
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}0
|
||||
+TEST wait
|
||||
+TEST $CLI volume start $V0 force
|
||||
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count ${V0}
|
||||
+EXPECT "12345" stat --format=%s $M0/a
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}1
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}2
|
||||
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0;
|
||||
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "4" ec_child_up_count $V0 0
|
||||
+cksum_after_heal=$(dd if=$M0/a | md5sum | awk '{print $1}')
|
||||
+TEST [[ $cksum == $cksum_after_heal ]]
|
||||
+cksum=$(dd if=$M0/c | md5sum | awk '{print $1}')
|
||||
+cksum_after_heal=$(dd if=$M0/b | md5sum | awk '{print $1}')
|
||||
+TEST [[ $cksum == $cksum_after_heal ]]
|
||||
+
|
||||
+cleanup;
|
||||
diff --git a/tests/basic/ec/ec-quorum-count.t b/tests/basic/ec/ec-quorum-count.t
|
||||
new file mode 100644
|
||||
index 0000000..56b5329
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ec/ec-quorum-count.t
|
||||
@@ -0,0 +1,165 @@
|
||||
+ #!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+. $(dirname $0)/../../ec.rc
|
||||
+
|
||||
+cleanup
|
||||
+TEST glusterd
|
||||
+TEST pidof glusterd
|
||||
+TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5}
|
||||
+TEST $CLI volume create $V1 $H0:$B0/${V1}{0..5}
|
||||
+TEST $CLI volume set $V0 disperse.eager-lock-timeout 5
|
||||
+TEST $CLI volume set $V0 performance.flush-behind off
|
||||
+
|
||||
+#Should fail on non-disperse volume
|
||||
+TEST ! $CLI volume set $V1 disperse.quorum-count 5
|
||||
+
|
||||
+#Should succeed on a valid range
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count 0
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count -0
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count abc
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count 10abc
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count 1
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count 2
|
||||
+TEST ! $CLI volume set $V0 disperse.quorum-count 3
|
||||
+TEST $CLI volume set $V0 disperse.quorum-count 4
|
||||
+TEST $CLI volume start $V0
|
||||
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+
|
||||
+#Test that the option is reflected in the mount
|
||||
+EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "^4$" ec_option_value $V0 $M0 0 quorum-count
|
||||
+TEST $CLI volume reset $V0 disperse.quorum-count
|
||||
+EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "^0$" ec_option_value $V0 $M0 0 quorum-count
|
||||
+TEST $CLI volume set $V0 disperse.quorum-count 6
|
||||
+EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "^6$" ec_option_value $V0 $M0 0 quorum-count
|
||||
+
|
||||
+TEST touch $M0/a
|
||||
+TEST touch $M0/data
|
||||
+TEST setfattr -n trusted.def -v def $M0/a
|
||||
+TEST touch $M0/src
|
||||
+TEST touch $M0/del-me
|
||||
+TEST mkdir $M0/dir1
|
||||
+TEST dd if=/dev/zero of=$M0/read-file bs=1M count=1 oflag=direct
|
||||
+TEST dd if=/dev/zero of=$M0/del-file bs=1M count=1 oflag=direct
|
||||
+TEST gf_rm_file_and_gfid_link $B0/${V0}0 del-file
|
||||
+#modify operations should fail as the file is not in quorum
|
||||
+TEST ! dd if=/dev/zero of=$M0/del-file bs=1M count=1 oflag=direct
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}0
|
||||
+#Read should succeed even when quorum-count is not met
|
||||
+TEST dd if=$M0/read-file of=/dev/null iflag=direct
|
||||
+TEST ! touch $M0/a2
|
||||
+TEST ! mkdir $M0/dir2
|
||||
+TEST ! mknod $M0/b2 b 4 5
|
||||
+TEST ! ln -s $M0/a $M0/symlink
|
||||
+TEST ! ln $M0/a $M0/link
|
||||
+TEST ! mv $M0/src $M0/dst
|
||||
+TEST ! rm -f $M0/del-me
|
||||
+TEST ! rmdir $M0/dir1
|
||||
+TEST ! dd if=/dev/zero of=$M0/a bs=1M count=1 conv=notrunc
|
||||
+TEST ! dd if=/dev/zero of=$M0/data bs=1M count=1 conv=notrunc
|
||||
+TEST ! truncate -s 0 $M0/a
|
||||
+TEST ! setfattr -n trusted.abc -v abc $M0/a
|
||||
+TEST ! setfattr -x trusted.def $M0/a
|
||||
+TEST ! chmod +x $M0/a
|
||||
+TEST ! fallocate -l 2m -n $M0/a
|
||||
+TEST ! fallocate -p -l 512k $M0/a
|
||||
+TEST $CLI volume start $V0 force
|
||||
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count ${V0}
|
||||
+
|
||||
+# reset the option and check whether the default redundancy count is
|
||||
+# accepted or not.
|
||||
+TEST $CLI volume reset $V0 disperse.quorum-count
|
||||
+EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "^0$" ec_option_value $V0 $M0 0 quorum-count
|
||||
+TEST touch $M0/a1
|
||||
+TEST touch $M0/data1
|
||||
+TEST setfattr -n trusted.def -v def $M0/a1
|
||||
+TEST touch $M0/src1
|
||||
+TEST touch $M0/del-me1
|
||||
+TEST mkdir $M0/dir11
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}0
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}1
|
||||
+TEST touch $M0/a21
|
||||
+TEST mkdir $M0/dir21
|
||||
+TEST mknod $M0/b21 b 4 5
|
||||
+TEST ln -s $M0/a1 $M0/symlink1
|
||||
+TEST ln $M0/a1 $M0/link1
|
||||
+TEST mv $M0/src1 $M0/dst1
|
||||
+TEST rm -f $M0/del-me1
|
||||
+TEST rmdir $M0/dir11
|
||||
+TEST dd if=/dev/zero of=$M0/a1 bs=1M count=1 conv=notrunc
|
||||
+TEST dd if=/dev/zero of=$M0/data1 bs=1M count=1 conv=notrunc
|
||||
+TEST truncate -s 0 $M0/a1
|
||||
+TEST setfattr -n trusted.abc -v abc $M0/a1
|
||||
+TEST setfattr -x trusted.def $M0/a1
|
||||
+TEST chmod +x $M0/a1
|
||||
+TEST fallocate -l 2m -n $M0/a1
|
||||
+TEST fallocate -p -l 512k $M0/a1
|
||||
+TEST $CLI volume start $V0 force
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+
|
||||
+TEST touch $M0/a2
|
||||
+TEST touch $M0/data2
|
||||
+TEST setfattr -n trusted.def -v def $M0/a1
|
||||
+TEST touch $M0/src2
|
||||
+TEST touch $M0/del-me2
|
||||
+TEST mkdir $M0/dir12
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}0
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}1
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}2
|
||||
+TEST ! touch $M0/a22
|
||||
+TEST ! mkdir $M0/dir22
|
||||
+TEST ! mknod $M0/b22 b 4 5
|
||||
+TEST ! ln -s $M0/a2 $M0/symlink2
|
||||
+TEST ! ln $M0/a2 $M0/link2
|
||||
+TEST ! mv $M0/src2 $M0/dst2
|
||||
+TEST ! rm -f $M0/del-me2
|
||||
+TEST ! rmdir $M0/dir12
|
||||
+TEST ! dd if=/dev/zero of=$M0/a2 bs=1M count=1 conv=notrunc
|
||||
+TEST ! dd if=/dev/zero of=$M0/data2 bs=1M count=1 conv=notrunc
|
||||
+TEST ! truncate -s 0 $M0/a2
|
||||
+TEST ! setfattr -n trusted.abc -v abc $M0/a2
|
||||
+TEST ! setfattr -x trusted.def $M0/a2
|
||||
+TEST ! chmod +x $M0/a2
|
||||
+TEST ! fallocate -l 2m -n $M0/a2
|
||||
+TEST ! fallocate -p -l 512k $M0/a2
|
||||
+TEST $CLI volume start $V0 force
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0
|
||||
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count ${V0}
|
||||
+
|
||||
+# Set quorum-count to 5 and kill 1 brick and the fops should pass
|
||||
+TEST $CLI volume set $V0 disperse.quorum-count 5
|
||||
+EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "^5$" ec_option_value $V0 $M0 0 quorum-count
|
||||
+TEST touch $M0/a3
|
||||
+TEST touch $M0/data3
|
||||
+TEST setfattr -n trusted.def -v def $M0/a3
|
||||
+TEST touch $M0/src3
|
||||
+TEST touch $M0/del-me3
|
||||
+TEST mkdir $M0/dir13
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}0
|
||||
+TEST touch $M0/a31
|
||||
+TEST mkdir $M0/dir31
|
||||
+TEST mknod $M0/b31 b 4 5
|
||||
+TEST ln -s $M0/a3 $M0/symlink3
|
||||
+TEST ln $M0/a3 $M0/link3
|
||||
+TEST mv $M0/src3 $M0/dst3
|
||||
+TEST rm -f $M0/del-me3
|
||||
+TEST rmdir $M0/dir13
|
||||
+TEST dd if=/dev/zero of=$M0/a3 bs=1M count=1 conv=notrunc
|
||||
+TEST dd if=/dev/zero of=$M0/data3 bs=1M count=1 conv=notrunc
|
||||
+TEST truncate -s 0 $M0/a3
|
||||
+TEST setfattr -n trusted.abc -v abc $M0/a3
|
||||
+TEST setfattr -x trusted.def $M0/a3
|
||||
+TEST chmod +x $M0/a3
|
||||
+TEST fallocate -l 2m -n $M0/a3
|
||||
+TEST fallocate -p -l 512k $M0/a3
|
||||
+TEST dd if=/dev/urandom of=$M0/heal-file bs=1M count=1 oflag=direct
|
||||
+cksum_before_heal="$(md5sum $M0/heal-file | awk '{print $1}')"
|
||||
+TEST $CLI volume start $V0 force
|
||||
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count ${V0}
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}4
|
||||
+TEST kill_brick $V0 $H0 $B0/${V0}5
|
||||
+cksum_after_heal=$(dd if=$M0/heal-file iflag=direct | md5sum | awk '{print $1}')
|
||||
+TEST [[ $cksum_before_heal == $cksum_after_heal ]]
|
||||
+cleanup;
|
||||
diff --git a/tests/ec.rc b/tests/ec.rc
|
||||
index 04405ec..f18752f 100644
|
||||
--- a/tests/ec.rc
|
||||
+++ b/tests/ec.rc
|
||||
@@ -7,3 +7,12 @@ function ec_up_status()
|
||||
local ec_id=$3
|
||||
grep -E "^up =" $m/.meta/graphs/active/${v}-disperse-${ec_id}/private | cut -f2 -d'='
|
||||
}
|
||||
+
|
||||
+function ec_option_value()
|
||||
+{
|
||||
+ local v=$1
|
||||
+ local m=$2
|
||||
+ local ec_id=$3
|
||||
+ local opt=$4
|
||||
+ grep -E "^$opt =" $m/.meta/graphs/active/${v}-disperse-${ec_id}/private | cut -f2 -d'='| awk '{print $1}'
|
||||
+}
|
||||
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
|
||||
index 92d4e5d..2e59180 100644
|
||||
--- a/xlators/cluster/ec/src/ec-common.c
|
||||
+++ b/xlators/cluster/ec/src/ec-common.c
|
||||
@@ -707,6 +707,19 @@ ec_child_select(ec_fop_data_t *fop)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (!fop->parent && fop->lock_count &&
|
||||
+ (fop->locks[0].update[EC_DATA_TXN] ||
|
||||
+ fop->locks[0].update[EC_METADATA_TXN])) {
|
||||
+ if (ec->quorum_count && (num < ec->quorum_count)) {
|
||||
+ gf_msg(ec->xl->name, GF_LOG_ERROR, 0, EC_MSG_CHILDS_INSUFFICIENT,
|
||||
+ "Insufficient available children "
|
||||
+ "for this request (have %d, need "
|
||||
+ "%d). %s",
|
||||
+ num, ec->quorum_count, ec_msg_str(fop));
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h
|
||||
index 3c69471..eab86ee 100644
|
||||
--- a/xlators/cluster/ec/src/ec-common.h
|
||||
+++ b/xlators/cluster/ec/src/ec-common.h
|
||||
@@ -26,6 +26,30 @@ typedef enum { EC_DATA_TXN, EC_METADATA_TXN } ec_txn_t;
|
||||
|
||||
#define EC_FLAG_LOCK_SHARED 0x0001
|
||||
|
||||
+#define QUORUM_CBK(fn, fop, frame, cookie, this, op_ret, op_errno, params...) \
|
||||
+ do { \
|
||||
+ ec_t *__ec = fop->xl->private; \
|
||||
+ int32_t __op_ret = 0; \
|
||||
+ int32_t __op_errno = 0; \
|
||||
+ int32_t __success_count = gf_bits_count(fop->good); \
|
||||
+ \
|
||||
+ __op_ret = op_ret; \
|
||||
+ __op_errno = op_errno; \
|
||||
+ if (!fop->parent && frame && \
|
||||
+ (GF_CLIENT_PID_SELF_HEALD != frame->root->pid) && \
|
||||
+ __ec->quorum_count && (__success_count < __ec->quorum_count) && \
|
||||
+ op_ret >= 0) { \
|
||||
+ __op_ret = -1; \
|
||||
+ __op_errno = EIO; \
|
||||
+ gf_msg(__ec->xl->name, GF_LOG_ERROR, 0, \
|
||||
+ EC_MSG_CHILDS_INSUFFICIENT, \
|
||||
+ "Insufficient available children for this request " \
|
||||
+ "(have %d, need %d). %s", \
|
||||
+ __success_count, __ec->quorum_count, ec_msg_str(fop)); \
|
||||
+ } \
|
||||
+ fn(frame, cookie, this, __op_ret, __op_errno, params); \
|
||||
+ } while (0)
|
||||
+
|
||||
enum _ec_xattrop_flags {
|
||||
EC_FLAG_XATTROP,
|
||||
EC_FLAG_DATA_DIRTY,
|
||||
diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c
|
||||
index 0b8ee21..8192462 100644
|
||||
--- a/xlators/cluster/ec/src/ec-dir-write.c
|
||||
+++ b/xlators/cluster/ec/src/ec-dir-write.c
|
||||
@@ -218,10 +218,10 @@ ec_manager_create(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.create != NULL) {
|
||||
- fop->cbks.create(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, fop->fd, fop->loc[0].inode,
|
||||
- &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.create, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, fop->fd,
|
||||
+ fop->loc[0].inode, &cbk->iatt[0], &cbk->iatt[1],
|
||||
+ &cbk->iatt[2], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -390,9 +390,10 @@ ec_manager_link(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.link != NULL) {
|
||||
- fop->cbks.link(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, fop->loc[0].inode, &cbk->iatt[0],
|
||||
- &cbk->iatt[1], &cbk->iatt[2], cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.link, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, fop->loc[0].inode,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
+ cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -569,9 +570,10 @@ ec_manager_mkdir(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.mkdir != NULL) {
|
||||
- fop->cbks.mkdir(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, fop->loc[0].inode, &cbk->iatt[0],
|
||||
- &cbk->iatt[1], &cbk->iatt[2], cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.mkdir, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, fop->loc[0].inode,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
+ cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -773,9 +775,10 @@ ec_manager_mknod(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.mknod != NULL) {
|
||||
- fop->cbks.mknod(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, fop->loc[0].inode, &cbk->iatt[0],
|
||||
- &cbk->iatt[1], &cbk->iatt[2], cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.mknod, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, fop->loc[0].inode,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
+ cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -931,10 +934,10 @@ ec_manager_rename(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.rename != NULL) {
|
||||
- fop->cbks.rename(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- &cbk->iatt[2], &cbk->iatt[3], &cbk->iatt[4],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.rename, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], &cbk->iatt[2], &cbk->iatt[3],
|
||||
+ &cbk->iatt[4], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -1083,9 +1086,9 @@ ec_manager_rmdir(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.rmdir != NULL) {
|
||||
- fop->cbks.rmdir(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.rmdir, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -1237,10 +1240,10 @@ ec_manager_symlink(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.symlink != NULL) {
|
||||
- fop->cbks.symlink(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, fop->loc[0].inode,
|
||||
- &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.symlink, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, fop->loc[0].inode,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], &cbk->iatt[2],
|
||||
+ cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -1392,9 +1395,9 @@ ec_manager_unlink(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.unlink != NULL) {
|
||||
- fop->cbks.unlink(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.unlink, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
|
||||
index 8bfa3b4..2dbb4db 100644
|
||||
--- a/xlators/cluster/ec/src/ec-inode-write.c
|
||||
+++ b/xlators/cluster/ec/src/ec-inode-write.c
|
||||
@@ -185,26 +185,26 @@ ec_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
|
||||
switch (fop->id) {
|
||||
case GF_FOP_SETXATTR:
|
||||
if (fop->cbks.setxattr) {
|
||||
- fop->cbks.setxattr(frame, cookie, this, op_ret, op_errno,
|
||||
- xdata);
|
||||
+ QUORUM_CBK(fop->cbks.setxattr, fop, frame, cookie, this, op_ret,
|
||||
+ op_errno, xdata);
|
||||
}
|
||||
break;
|
||||
case GF_FOP_REMOVEXATTR:
|
||||
if (fop->cbks.removexattr) {
|
||||
- fop->cbks.removexattr(frame, cookie, this, op_ret, op_errno,
|
||||
- xdata);
|
||||
+ QUORUM_CBK(fop->cbks.removexattr, fop, frame, cookie, this,
|
||||
+ op_ret, op_errno, xdata);
|
||||
}
|
||||
break;
|
||||
case GF_FOP_FSETXATTR:
|
||||
if (fop->cbks.fsetxattr) {
|
||||
- fop->cbks.fsetxattr(frame, cookie, this, op_ret, op_errno,
|
||||
- xdata);
|
||||
+ QUORUM_CBK(fop->cbks.fsetxattr, fop, frame, cookie, this,
|
||||
+ op_ret, op_errno, xdata);
|
||||
}
|
||||
break;
|
||||
case GF_FOP_FREMOVEXATTR:
|
||||
if (fop->cbks.fremovexattr) {
|
||||
- fop->cbks.fremovexattr(frame, cookie, this, op_ret, op_errno,
|
||||
- xdata);
|
||||
+ QUORUM_CBK(fop->cbks.fremovexattr, fop, frame, cookie, this,
|
||||
+ op_ret, op_errno, xdata);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -494,16 +494,15 @@ ec_manager_setattr(ec_fop_data_t *fop, int32_t state)
|
||||
|
||||
if (fop->id == GF_FOP_SETATTR) {
|
||||
if (fop->cbks.setattr != NULL) {
|
||||
- fop->cbks.setattr(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0],
|
||||
- &cbk->iatt[1], cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.setattr, fop, fop->req_frame, fop,
|
||||
+ fop->xl, cbk->op_ret, cbk->op_errno,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
} else {
|
||||
if (fop->cbks.fsetattr != NULL) {
|
||||
- fop->cbks.fsetattr(fop->req_frame, fop, fop->xl,
|
||||
- cbk->op_ret, cbk->op_errno,
|
||||
- &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.fsetattr, fop, fop->req_frame, fop,
|
||||
+ fop->xl, cbk->op_ret, cbk->op_errno,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -994,9 +993,9 @@ ec_manager_fallocate(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.fallocate != NULL) {
|
||||
- fop->cbks.fallocate(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.fallocate, fop, fop->req_frame, fop,
|
||||
+ fop->xl, cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -1247,9 +1246,9 @@ ec_manager_discard(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.discard != NULL) {
|
||||
- fop->cbks.discard(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.discard, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
@@ -1477,17 +1476,15 @@ ec_manager_truncate(ec_fop_data_t *fop, int32_t state)
|
||||
|
||||
if (fop->id == GF_FOP_TRUNCATE) {
|
||||
if (fop->cbks.truncate != NULL) {
|
||||
- fop->cbks.truncate(fop->req_frame, fop, fop->xl,
|
||||
- cbk->op_ret, cbk->op_errno,
|
||||
- &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.truncate, fop, fop->req_frame, fop,
|
||||
+ fop->xl, cbk->op_ret, cbk->op_errno,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
} else {
|
||||
if (fop->cbks.ftruncate != NULL) {
|
||||
- fop->cbks.ftruncate(fop->req_frame, fop, fop->xl,
|
||||
- cbk->op_ret, cbk->op_errno,
|
||||
- &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.ftruncate, fop, fop->req_frame, fop,
|
||||
+ fop->xl, cbk->op_ret, cbk->op_errno,
|
||||
+ &cbk->iatt[0], &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2245,9 +2242,9 @@ ec_manager_writev(ec_fop_data_t *fop, int32_t state)
|
||||
GF_ASSERT(cbk != NULL);
|
||||
|
||||
if (fop->cbks.writev != NULL) {
|
||||
- fop->cbks.writev(fop->req_frame, fop, fop->xl, cbk->op_ret,
|
||||
- cbk->op_errno, &cbk->iatt[0], &cbk->iatt[1],
|
||||
- cbk->xdata);
|
||||
+ QUORUM_CBK(fop->cbks.writev, fop, fop->req_frame, fop, fop->xl,
|
||||
+ cbk->op_ret, cbk->op_errno, &cbk->iatt[0],
|
||||
+ &cbk->iatt[1], cbk->xdata);
|
||||
}
|
||||
|
||||
return EC_STATE_LOCK_REUSE;
|
||||
diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h
|
||||
index f27f2ec..ea4f6ad 100644
|
||||
--- a/xlators/cluster/ec/src/ec-types.h
|
||||
+++ b/xlators/cluster/ec/src/ec-types.h
|
||||
@@ -654,6 +654,7 @@ struct _ec {
|
||||
gf_boolean_t optimistic_changelog;
|
||||
gf_boolean_t parallel_writes;
|
||||
uint32_t stripe_cache;
|
||||
+ uint32_t quorum_count;
|
||||
uint32_t background_heals;
|
||||
uint32_t heal_wait_qlen;
|
||||
uint32_t self_heal_window_size; /* max size of read/writes */
|
||||
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
|
||||
index 3c8013e..19094c4 100644
|
||||
--- a/xlators/cluster/ec/src/ec.c
|
||||
+++ b/xlators/cluster/ec/src/ec.c
|
||||
@@ -285,6 +285,7 @@ reconfigure(xlator_t *this, dict_t *options)
|
||||
GF_OPTION_RECONF("parallel-writes", ec->parallel_writes, options, bool,
|
||||
failed);
|
||||
GF_OPTION_RECONF("stripe-cache", ec->stripe_cache, options, uint32, failed);
|
||||
+ GF_OPTION_RECONF("quorum-count", ec->quorum_count, options, uint32, failed);
|
||||
ret = 0;
|
||||
if (ec_assign_read_policy(ec, read_policy)) {
|
||||
ret = -1;
|
||||
@@ -720,6 +721,7 @@ init(xlator_t *this)
|
||||
failed);
|
||||
GF_OPTION_INIT("parallel-writes", ec->parallel_writes, bool, failed);
|
||||
GF_OPTION_INIT("stripe-cache", ec->stripe_cache, uint32, failed);
|
||||
+ GF_OPTION_INIT("quorum-count", ec->quorum_count, uint32, failed);
|
||||
|
||||
this->itable = inode_table_new(EC_SHD_INODE_LRU_LIMIT, this);
|
||||
if (!this->itable)
|
||||
@@ -1402,6 +1404,7 @@ ec_dump_private(xlator_t *this)
|
||||
gf_proc_dump_write("heal-waiters", "%d", ec->heal_waiters);
|
||||
gf_proc_dump_write("read-policy", "%s", ec_read_policies[ec->read_policy]);
|
||||
gf_proc_dump_write("parallel-writes", "%d", ec->parallel_writes);
|
||||
+ gf_proc_dump_write("quorum-count", "%u", ec->quorum_count);
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s.stats.stripe_cache",
|
||||
this->type, this->name);
|
||||
@@ -1672,6 +1675,16 @@ struct volume_options options[] = {
|
||||
"lead to extra memory consumption, maximum "
|
||||
"(cache size * stripe size) Bytes per open file."},
|
||||
{
|
||||
+ .key = {"quorum-count"},
|
||||
+ .type = GF_OPTION_TYPE_INT,
|
||||
+ .default_value = "0",
|
||||
+ .description =
|
||||
+ "This option can be used to define how many successes on"
|
||||
+ "the bricks constitute a success to the application. This"
|
||||
+ " count should be in the range"
|
||||
+ "[disperse-data-count, disperse-count] (inclusive)",
|
||||
+ },
|
||||
+ {
|
||||
.key = {NULL},
|
||||
},
|
||||
};
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
index 8ce338e..7ca47a6 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
@@ -1128,6 +1128,42 @@ out:
|
||||
}
|
||||
|
||||
static int
|
||||
+validate_disperse_quorum_count(glusterd_volinfo_t *volinfo, dict_t *dict,
|
||||
+ char *key, char *value, char **op_errstr)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+ int quorum_count = 0;
|
||||
+ int data_count = 0;
|
||||
+
|
||||
+ ret = gf_string2int(value, &quorum_count);
|
||||
+ if (ret) {
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "%s is not an integer. %s expects a "
|
||||
+ "valid integer value.",
|
||||
+ value, key);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (volinfo->type != GF_CLUSTER_TYPE_DISPERSE) {
|
||||
+ gf_asprintf(op_errstr, "Cannot set %s for a non-disperse volume.", key);
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ data_count = volinfo->disperse_count - volinfo->redundancy_count;
|
||||
+ if (quorum_count < data_count || quorum_count > volinfo->disperse_count) {
|
||||
+ gf_asprintf(op_errstr, "%d for %s is out of range [%d - %d]",
|
||||
+ quorum_count, key, data_count, volinfo->disperse_count);
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+out:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
validate_parallel_readdir(glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
|
||||
char *value, char **op_errstr)
|
||||
{
|
||||
@@ -3663,6 +3699,16 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
||||
.type = NO_DOC,
|
||||
.op_version = GD_OP_VERSION_3_13_0,
|
||||
.flags = VOLOPT_FLAG_CLIENT_OPT},
|
||||
+ {.key = "disperse.quorum-count",
|
||||
+ .voltype = "cluster/disperse",
|
||||
+ .type = NO_DOC,
|
||||
+ .op_version = GD_OP_VERSION_8_0,
|
||||
+ .validate_fn = validate_disperse_quorum_count,
|
||||
+ .description = "This option can be used to define how many successes on"
|
||||
+ "the bricks constitute a success to the application. This"
|
||||
+ " count should be in the range"
|
||||
+ "[disperse-data-count, disperse-count] (inclusive)",
|
||||
+ .flags = VOLOPT_FLAG_CLIENT_OPT},
|
||||
{
|
||||
.key = "features.sdfs",
|
||||
.voltype = "features/sdfs",
|
||||
--
|
||||
1.8.3.1
|
||||
|
84
0290-glusterd-tag-disperse.quorum-count-for-31306.patch
Normal file
84
0290-glusterd-tag-disperse.quorum-count-for-31306.patch
Normal file
@ -0,0 +1,84 @@
|
||||
From 312da653ac80b537af06139f8d83a63180c72461 Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Tue, 10 Sep 2019 14:04:17 +0530
|
||||
Subject: [PATCH 290/297] glusterd: tag disperse.quorum-count for 31306
|
||||
|
||||
In upstream disperse.quorum-count is makred for release-8
|
||||
latest new op-version is 31306.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
fixes: bz#1748688
|
||||
Change-Id: I88fdbd56ce3b8475b5ec670659adaa9d11c01d97
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/180675
|
||||
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
libglusterfs/src/glusterfs/globals.h | 12 ++++++------
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 2 +-
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h
|
||||
index bdc8b3d..e218285 100644
|
||||
--- a/libglusterfs/src/glusterfs/globals.h
|
||||
+++ b/libglusterfs/src/glusterfs/globals.h
|
||||
@@ -50,19 +50,19 @@
|
||||
1 /* MIN is the fresh start op-version, mostly \
|
||||
should not change */
|
||||
#define GD_OP_VERSION_MAX \
|
||||
- GD_OP_VERSION_8_0 /* MAX VERSION is the maximum \
|
||||
+ GD_OP_VERSION_7_0 /* MAX VERSION is the maximum \
|
||||
count in VME table, should \
|
||||
keep changing with \
|
||||
introduction of newer \
|
||||
versions */
|
||||
|
||||
-#define GD_OP_VERSION_RHS_3_0 30000 /* Op-Version of RHS 3.0 */
|
||||
+#define GD_OP_VERSION_RHS_3_0 30000 /* Op-Version of RHS 3.0 */
|
||||
|
||||
#define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_RHS_3_0
|
||||
|
||||
-#define GD_OP_VERSION_RHS_2_1_5 20105 /* RHS 2.1 update 5 */
|
||||
+#define GD_OP_VERSION_RHS_2_1_5 20105 /* RHS 2.1 update 5 */
|
||||
|
||||
-#define GD_OP_VERSION_RHS_3_0_4 30004 /* Op-Version of RHS 3.0.4 */
|
||||
+#define GD_OP_VERSION_RHS_3_0_4 30004 /* Op-Version of RHS 3.0.4 */
|
||||
|
||||
#define GD_OP_VERSION_3_7_0 30700 /* Op-version for GlusterFS 3.7.0 */
|
||||
|
||||
@@ -124,6 +124,8 @@
|
||||
|
||||
#define GD_OP_VERSION_3_13_5 31305 /* Op-version for GlusterFS 3.13.5 */
|
||||
|
||||
+#define GD_OP_VERSION_3_13_6 31306 /* Op-version for GlusterFS 3.13.6 */
|
||||
+
|
||||
#define GD_OP_VERSION_4_0_0 40000 /* Op-version for GlusterFS 4.0.0 */
|
||||
|
||||
#define GD_OP_VERSION_4_1_0 40100 /* Op-version for GlusterFS 4.1.0 */
|
||||
@@ -136,8 +138,6 @@
|
||||
|
||||
#define GD_OP_VERSION_7_0 70000 /* Op-version for GlusterFS 7.0 */
|
||||
|
||||
-#define GD_OP_VERSION_8_0 80000 /* Op-version for GlusterFS 8.0 */
|
||||
-
|
||||
#include "glusterfs/xlator.h"
|
||||
#include "glusterfs/options.h"
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
index 7ca47a6..16601a2 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
@@ -3702,7 +3702,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
||||
{.key = "disperse.quorum-count",
|
||||
.voltype = "cluster/disperse",
|
||||
.type = NO_DOC,
|
||||
- .op_version = GD_OP_VERSION_8_0,
|
||||
+ .op_version = GD_OP_VERSION_3_13_6,
|
||||
.validate_fn = validate_disperse_quorum_count,
|
||||
.description = "This option can be used to define how many successes on"
|
||||
"the bricks constitute a success to the application. This"
|
||||
--
|
||||
1.8.3.1
|
||||
|
106
0291-cluster-ec-Mark-release-only-when-it-is-acquired.patch
Normal file
106
0291-cluster-ec-Mark-release-only-when-it-is-acquired.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From 87d8070f80487322a1736846a78725fd88f8de34 Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Tue, 20 Aug 2019 13:27:24 +0530
|
||||
Subject: [PATCH 291/297] cluster/ec: Mark release only when it is acquired
|
||||
|
||||
Problem:
|
||||
Mount-1 Mount-2
|
||||
1)Tries to acquire lock on 'dir1' 1)Tries to acquire lock on 'dir1'
|
||||
2)Lock is granted on brick-0 2)Lock gets EAGAIN on brick-0 and
|
||||
leads to blocking lock on brick-0
|
||||
3)Gets a lock-contention 3) Doesn't matter what happens on mount-2
|
||||
notification, marks lock->release from here on.
|
||||
to true.
|
||||
4)New fop comes on 'dir1' which will
|
||||
be put in frozen list as lock->release
|
||||
is set to true.
|
||||
5) Lock acquisition from step-2 fails because
|
||||
3 bricks went down in 4+2 setup.
|
||||
|
||||
Fop on mount-1 which is put in frozen list will hang because no codepath will
|
||||
move it from frozen list to any other list and the lock will not be retried.
|
||||
|
||||
Fix:
|
||||
Don't set lock->release to true if lock is not acquired at the time of
|
||||
lock-contention-notification
|
||||
|
||||
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23272
|
||||
fixes: bz#1731896
|
||||
Change-Id: Ie6630db8735ccf372cc54b873a3a3aed7a6082b7
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/180870
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/cluster/ec/src/ec-common.c | 20 ++++++++++++++++++--
|
||||
xlators/cluster/ec/src/ec-types.h | 1 +
|
||||
2 files changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
|
||||
index 2e59180..5cae37b 100644
|
||||
--- a/xlators/cluster/ec/src/ec-common.c
|
||||
+++ b/xlators/cluster/ec/src/ec-common.c
|
||||
@@ -1867,6 +1867,10 @@ ec_lock_acquired(ec_lock_link_t *link)
|
||||
LOCK(&lock->loc.inode->lock);
|
||||
|
||||
lock->acquired = _gf_true;
|
||||
+ if (lock->contention) {
|
||||
+ lock->release = _gf_true;
|
||||
+ lock->contention = _gf_false;
|
||||
+ }
|
||||
|
||||
ec_lock_update_fd(lock, fop);
|
||||
ec_lock_wake_shared(lock, &list);
|
||||
@@ -1892,15 +1896,20 @@ ec_locked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
|
||||
ec_lock_link_t *link = NULL;
|
||||
ec_lock_t *lock = NULL;
|
||||
|
||||
+ link = fop->data;
|
||||
+ lock = link->lock;
|
||||
if (op_ret >= 0) {
|
||||
- link = fop->data;
|
||||
- lock = link->lock;
|
||||
lock->mask = lock->good_mask = fop->good;
|
||||
lock->healing = 0;
|
||||
|
||||
ec_lock_acquired(link);
|
||||
ec_lock(fop->parent);
|
||||
} else {
|
||||
+ LOCK(&lock->loc.inode->lock);
|
||||
+ {
|
||||
+ lock->contention = _gf_false;
|
||||
+ }
|
||||
+ UNLOCK(&lock->loc.inode->lock);
|
||||
gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_PREOP_LOCK_FAILED,
|
||||
"Failed to complete preop lock");
|
||||
}
|
||||
@@ -2547,6 +2556,13 @@ ec_lock_release(ec_t *ec, inode_t *inode)
|
||||
gf_msg_debug(ec->xl->name, 0, "Releasing inode %p due to lock contention",
|
||||
inode);
|
||||
|
||||
+ if (!lock->acquired) {
|
||||
+ /* This happens if some bricks already got the lock while inodelk is in
|
||||
+ * progress. Set release to true after lock is acquired*/
|
||||
+ lock->contention = _gf_true;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
/* The lock is not marked to be released, so the frozen list should be
|
||||
* empty. */
|
||||
GF_ASSERT(list_empty(&lock->frozen));
|
||||
diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h
|
||||
index ea4f6ad..34a9768 100644
|
||||
--- a/xlators/cluster/ec/src/ec-types.h
|
||||
+++ b/xlators/cluster/ec/src/ec-types.h
|
||||
@@ -267,6 +267,7 @@ struct _ec_lock {
|
||||
uint32_t refs_pending; /* Refs assigned to fops being prepared */
|
||||
uint32_t waiting_flags; /*Track xattrop/dirty marking*/
|
||||
gf_boolean_t acquired;
|
||||
+ gf_boolean_t contention;
|
||||
gf_boolean_t unlock_now;
|
||||
gf_boolean_t release;
|
||||
gf_boolean_t query;
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,72 @@
|
||||
From 769263ad422e3c1069de0994ff2274044982b242 Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Sun, 1 Sep 2019 12:01:09 +0530
|
||||
Subject: [PATCH 292/297] rpc: Update address family if it is not provide in
|
||||
cmd-line arguments
|
||||
|
||||
Problem: After enabling transport-type to inet6 and passed ipv6
|
||||
transport.socket.bind-address in glusterd.vol clients are
|
||||
not started.
|
||||
|
||||
Solution: Need to update address-family based on remote-address for
|
||||
all gluster client process
|
||||
|
||||
> Change-Id: Iaa3588cd87cebc45231bfd675745c1a457dc9b31
|
||||
> Fixes: bz#1747746
|
||||
> Credits: Amgad Saleh <amgad.saleh@nokia.com>
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> (Cherry picked from commit 80b8cfe3f1386606bada97a76a0cad7acdf6b877)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23340/)
|
||||
|
||||
Change-Id: Iaa3588cd87cebc45231bfd675745c1a457dc9b31
|
||||
BUG: 1750241
|
||||
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/181184
|
||||
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
rpc/rpc-transport/socket/src/name.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
|
||||
index 7f18cc4..b473f3b 100644
|
||||
--- a/rpc/rpc-transport/socket/src/name.c
|
||||
+++ b/rpc/rpc-transport/socket/src/name.c
|
||||
@@ -214,6 +214,7 @@ af_inet_client_get_remote_sockaddr(rpc_transport_t *this,
|
||||
uint16_t remote_port = 0;
|
||||
struct addrinfo *addr_info = NULL;
|
||||
int32_t ret = 0;
|
||||
+ struct in6_addr serveraddr;
|
||||
|
||||
remote_host_data = dict_get(options, "remote-host");
|
||||
if (remote_host_data == NULL) {
|
||||
@@ -249,6 +250,13 @@ af_inet_client_get_remote_sockaddr(rpc_transport_t *this,
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ /* Need to update transport-address family if address-family is not provide
|
||||
+ to command-line arguments
|
||||
+ */
|
||||
+ if (inet_pton(AF_INET6, remote_host, &serveraddr)) {
|
||||
+ sockaddr->sa_family = AF_INET6;
|
||||
+ }
|
||||
+
|
||||
/* TODO: gf_resolve is a blocking call. kick in some
|
||||
non blocking dns techniques */
|
||||
ret = gf_resolve_ip6(remote_host, remote_port, sockaddr->sa_family,
|
||||
@@ -522,7 +530,10 @@ socket_client_get_remote_sockaddr(rpc_transport_t *this,
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
- if (*sa_family == AF_UNSPEC) {
|
||||
+ /* Address-family is updated based on remote_host in
|
||||
+ af_inet_client_get_remote_sockaddr
|
||||
+ */
|
||||
+ if (*sa_family != sockaddr->sa_family) {
|
||||
*sa_family = sockaddr->sa_family;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,69 @@
|
||||
From 8f89aef9691b0806d7487525c6a54a1a615c8bc1 Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Mon, 2 Sep 2019 10:46:10 +0530
|
||||
Subject: [PATCH 293/297] glusterd: IPV6 hostname address is not parsed
|
||||
correctly
|
||||
|
||||
Problem: IPV6 hostname address is not parsed correctly in function
|
||||
glusterd_check_brick_order
|
||||
|
||||
Solution: Update the code to parse hostname address
|
||||
|
||||
> Change-Id: Ifb2f83f9c6e987b2292070e048e97eeb51b728ab
|
||||
> Fixes: bz#1747746
|
||||
> Credits: Amgad Saleh <amgad.saleh@nokia.com>
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> (Cherry picked from commit 6563ffb04d7ba51a89726e7c5bbb85c7dbc685b5)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23341/)
|
||||
|
||||
Change-Id: Ifb2f83f9c6e987b2292070e048e97eeb51b728ab
|
||||
BUG: 1750241
|
||||
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/181185
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 16 +++++++++++-----
|
||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
index 1ea8ba6..076bc80 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
@@ -95,6 +95,10 @@ glusterd_check_brick_order(dict_t *dict, char *err_str)
|
||||
int32_t type = GF_CLUSTER_TYPE_NONE;
|
||||
int32_t sub_count = 0;
|
||||
struct addrinfo *ai_info = NULL;
|
||||
+ char brick_addr[128] = {
|
||||
+ 0,
|
||||
+ };
|
||||
+ int addrlen = 0;
|
||||
|
||||
const char failed_string[2048] =
|
||||
"Failed to perform brick order "
|
||||
@@ -182,15 +186,17 @@ glusterd_check_brick_order(dict_t *dict, char *err_str)
|
||||
brick_list_dup = tmpptr;
|
||||
if (brick == NULL)
|
||||
goto check_failed;
|
||||
- brick = strtok_r(brick, ":", &tmpptr);
|
||||
- if (brick == NULL)
|
||||
+ tmpptr = strrchr(brick, ':');
|
||||
+ if (tmpptr == NULL)
|
||||
goto check_failed;
|
||||
- ret = getaddrinfo(brick, NULL, NULL, &ai_info);
|
||||
+ addrlen = strlen(brick) - strlen(tmpptr);
|
||||
+ strncpy(brick_addr, brick, addrlen);
|
||||
+ brick_addr[addrlen] = '\0';
|
||||
+ ret = getaddrinfo(brick_addr, NULL, NULL, &ai_info);
|
||||
if (ret != 0) {
|
||||
ret = 0;
|
||||
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_HOSTNAME_RESOLVE_FAIL,
|
||||
- "unable to resolve "
|
||||
- "host name");
|
||||
+ "unable to resolve host name for addr %s", brick_addr);
|
||||
goto out;
|
||||
}
|
||||
ai_list_tmp1 = MALLOC(sizeof(addrinfo_list_t));
|
||||
--
|
||||
1.8.3.1
|
||||
|
59
0294-eventsapi-Set-IPv4-IPv6-family-based-on-input-IP.patch
Normal file
59
0294-eventsapi-Set-IPv4-IPv6-family-based-on-input-IP.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From 2fa5476b95d4547bdde50f2281bf58b7db24e37a Mon Sep 17 00:00:00 2001
|
||||
From: Aravinda VK <avishwan@redhat.com>
|
||||
Date: Mon, 16 Sep 2019 10:04:26 +0530
|
||||
Subject: [PATCH 294/297] eventsapi: Set IPv4/IPv6 family based on input IP
|
||||
|
||||
server.sin_family was set to AF_INET while creating socket connection,
|
||||
this was failing if the input address is IPv6(`::1`).
|
||||
|
||||
With this patch, sin_family is set by reading the ai_family of
|
||||
`getaddrinfo` result.
|
||||
|
||||
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/23423/
|
||||
|
||||
>Fixes: bz#1752330
|
||||
>Change-Id: I499f957b432842fa989c698f6e5b25b7016084eb
|
||||
>Signed-off-by: Aravinda VK <avishwan@redhat.com>
|
||||
|
||||
BUG: 1732443
|
||||
Change-Id: I499f957b432842fa989c698f6e5b25b7016084eb
|
||||
Signed-off-by: Aravinda VK <avishwan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/181197
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
libglusterfs/src/events.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c
|
||||
index 2509767..9d33783 100644
|
||||
--- a/libglusterfs/src/events.c
|
||||
+++ b/libglusterfs/src/events.c
|
||||
@@ -42,6 +42,7 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *result = NULL;
|
||||
xlator_t *this = THIS;
|
||||
+ int sin_family = AF_INET;
|
||||
|
||||
/* Global context */
|
||||
ctx = THIS->ctx;
|
||||
@@ -75,13 +76,15 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
|
||||
ret = EVENT_ERROR_RESOLVE;
|
||||
goto out;
|
||||
}
|
||||
+
|
||||
+ sin_family = result->ai_family;
|
||||
} else {
|
||||
/* Localhost, Use the defined IP for localhost */
|
||||
host = gf_strdup(EVENT_HOST);
|
||||
}
|
||||
|
||||
/* Socket Configurations */
|
||||
- server.sin_family = AF_INET;
|
||||
+ server.sin_family = sin_family;
|
||||
server.sin_port = htons(EVENT_PORT);
|
||||
ret = inet_pton(server.sin_family, host, &server.sin_addr);
|
||||
if (ret <= 0) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
1164
0295-ctime-rebalance-Heal-ctime-xattr-on-directory-during.patch
Normal file
1164
0295-ctime-rebalance-Heal-ctime-xattr-on-directory-during.patch
Normal file
File diff suppressed because it is too large
Load Diff
62
0296-glusterfind-pre-command-failure-on-a-modify.patch
Normal file
62
0296-glusterfind-pre-command-failure-on-a-modify.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From bfb64a0e685eb5755ceda6c54690335564e135c9 Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Mon, 16 Sep 2019 14:22:34 +0530
|
||||
Subject: [PATCH 296/297] glusterfind: pre command failure on a modify
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
On upstream we have gfid_to_all_paths_using_gfid2path instead of
|
||||
gfid_to_path_using_pgfid and so we do not hit this in upstream.
|
||||
|
||||
Problem: On a modify, the pre commands runs through the find function.
|
||||
where the number of arguments sent mismatches and causes a stderr.
|
||||
The mismatch is because of both changelog and brickfind use the find(),
|
||||
but the brickfind was alone handled.
|
||||
|
||||
Fix: Have handled the additional argument on the changelog side as well.
|
||||
Received it as a dummy variable for changelog.
|
||||
|
||||
Change-Id: I5eecdd993e477b68a0e486db2ad7e56ba94bbf02
|
||||
fixes: bz#1733970
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/181095
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
|
||||
Reviewed-by: Rinku Kothiya <rkothiya@redhat.com>
|
||||
---
|
||||
tools/glusterfind/src/changelog.py | 5 +++--
|
||||
tools/glusterfind/src/utils.py | 2 +-
|
||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/glusterfind/src/changelog.py b/tools/glusterfind/src/changelog.py
|
||||
index 40c381b..ef982db 100644
|
||||
--- a/tools/glusterfind/src/changelog.py
|
||||
+++ b/tools/glusterfind/src/changelog.py
|
||||
@@ -141,8 +141,9 @@ def gfid_to_path_using_pgfid(brick, changelog_data, args):
|
||||
|
||||
# Length of brick path, to remove from output path
|
||||
brick_path_len = len(brick)
|
||||
-
|
||||
- def output_callback(path, inode):
|
||||
+ # is_dir is a dummy variable to make it compitable with the find
|
||||
+ # used in brickfind
|
||||
+ def output_callback(path, inode, is_dir):
|
||||
# For each path found, encodes it and updates path1
|
||||
# Also updates converted flag in inodegfid table as 1
|
||||
path = path.strip()
|
||||
diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py
|
||||
index cc09903..e226c5a 100644
|
||||
--- a/tools/glusterfind/src/utils.py
|
||||
+++ b/tools/glusterfind/src/utils.py
|
||||
@@ -70,7 +70,7 @@ def find(path, callback_func=lambda x: True, filter_func=lambda x: True,
|
||||
else:
|
||||
filter_result = filter_func(full_path)
|
||||
if filter_result is not None:
|
||||
- callback_func(full_path, filter_result)
|
||||
+ callback_func(full_path, filter_result, None)
|
||||
else:
|
||||
filter_result = filter_func(full_path)
|
||||
if filter_result is not None:
|
||||
--
|
||||
1.8.3.1
|
||||
|
89
0297-rpmbuild-fixing-the-build-errors-with-2a905a8ae.patch
Normal file
89
0297-rpmbuild-fixing-the-build-errors-with-2a905a8ae.patch
Normal file
@ -0,0 +1,89 @@
|
||||
From 37555b6c83d3a979033111a754ee1728dab254f5 Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Wed, 18 Sep 2019 17:38:52 +0530
|
||||
Subject: [PATCH 297/297] rpmbuild: fixing the build errors with 2a905a8ae
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Have added a Makefile inside extras/quota to remove the
|
||||
No rule to make target error for quota/log_accounting.sh
|
||||
|
||||
Change-Id: Ia3f6b3fa21a0de7eb3bdb31b3d205139df412aca
|
||||
fixes: bz#1719171
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/181326
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
extras/Makefile.am | 6 +-----
|
||||
extras/quota/Makefile.am | 8 ++++++++
|
||||
3 files changed, 10 insertions(+), 5 deletions(-)
|
||||
create mode 100644 extras/quota/Makefile.am
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f597b86..327733e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -232,6 +232,7 @@ AC_CONFIG_FILES([Makefile
|
||||
extras/hook-scripts/reset/pre/Makefile
|
||||
extras/python/Makefile
|
||||
extras/snap_scheduler/Makefile
|
||||
+ extras/quota/Makefile
|
||||
events/Makefile
|
||||
events/src/Makefile
|
||||
events/src/eventsapiconf.py
|
||||
diff --git a/extras/Makefile.am b/extras/Makefile.am
|
||||
index 8cbfda1..31ccdf5 100644
|
||||
--- a/extras/Makefile.am
|
||||
+++ b/extras/Makefile.am
|
||||
@@ -12,7 +12,7 @@ EditorMode_DATA = glusterfs-mode.el glusterfs.vim
|
||||
|
||||
SUBDIRS = init.d systemd benchmarking hook-scripts $(OCF_SUBDIR) LinuxRPM \
|
||||
$(GEOREP_EXTRAS_SUBDIR) snap_scheduler firewalld cliutils python \
|
||||
- ganesha
|
||||
+ ganesha quota
|
||||
|
||||
confdir = $(sysconfdir)/glusterfs
|
||||
if WITH_SERVER
|
||||
@@ -30,14 +30,11 @@ endif
|
||||
|
||||
scriptsdir = $(datadir)/glusterfs/scripts
|
||||
scripts_SCRIPTS = thin-arbiter/setup-thin-arbiter.sh
|
||||
-scripts_SCRIPTS += quota/log_accounting.sh
|
||||
scripts_SCRIPTS += collect-system-stats.sh
|
||||
scripts_SCRIPTS += identify-hangs.sh
|
||||
if WITH_SERVER
|
||||
scripts_SCRIPTS += post-upgrade-script-for-quota.sh \
|
||||
pre-upgrade-script-for-quota.sh stop-all-gluster-processes.sh
|
||||
-scripts_SCRIPTS += quota/quota_fsck.py
|
||||
-scripts_SCRIPTS += quota/xattr_analysis.py
|
||||
if USE_SYSTEMD
|
||||
scripts_SCRIPTS += control-cpu-load.sh
|
||||
scripts_SCRIPTS += control-mem.sh
|
||||
@@ -56,7 +53,6 @@ EXTRA_DIST = glusterfs-logrotate gluster-rsyslog-7.2.conf gluster-rsyslog-5.8.co
|
||||
stop-all-gluster-processes.sh clang-checker.sh mount-shared-storage.sh \
|
||||
control-cpu-load.sh control-mem.sh group-distributed-virt \
|
||||
thin-arbiter/thin-arbiter.vol thin-arbiter/setup-thin-arbiter.sh \
|
||||
- quota/xattr_analysis.py quota/quota_fsck.py quota/log_accounting.sh \
|
||||
collect-system-stats.sh identify-hangs.sh
|
||||
|
||||
if WITH_SERVER
|
||||
diff --git a/extras/quota/Makefile.am b/extras/quota/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..cdb6be1
|
||||
--- /dev/null
|
||||
+++ b/extras/quota/Makefile.am
|
||||
@@ -0,0 +1,8 @@
|
||||
+scriptsdir = $(datadir)/glusterfs/scripts
|
||||
+scripts_SCRIPTS = log_accounting.sh
|
||||
+
|
||||
+if WITH_SERVER
|
||||
+scripts_SCRIPTS += xattr_analysis.py quota_fsck.py
|
||||
+endif
|
||||
+
|
||||
+EXTRA_DIST = log_accounting.sh xattr_analysis.py quota_fsck.py
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -231,7 +231,7 @@ Release: 0.1%{?prereltag:.%{prereltag}}%{?dist}
|
||||
%else
|
||||
Name: glusterfs
|
||||
Version: 6.0
|
||||
Release: 13%{?dist}
|
||||
Release: 14%{?dist}
|
||||
ExcludeArch: i686
|
||||
%endif
|
||||
License: GPLv2 or LGPLv3+
|
||||
@ -593,6 +593,19 @@ Patch0281: 0281-ctime-Fix-incorrect-realtime-passed-to-frame-root-ct.patch
|
||||
Patch0282: 0282-geo-rep-Fix-the-name-of-changelog-archive-file.patch
|
||||
Patch0283: 0283-ctime-Fix-ctime-issue-with-utime-family-of-syscalls.patch
|
||||
Patch0284: 0284-posix-log-aio_error-return-codes-in-posix_fs_health_.patch
|
||||
Patch0285: 0285-glusterd-glusterd-service-is-getting-timed-out-on-sc.patch
|
||||
Patch0286: 0286-glusterfs.spec.in-added-script-files-for-machine-com.patch
|
||||
Patch0287: 0287-cluster-ec-Fail-fsync-flush-for-files-on-update-size.patch
|
||||
Patch0288: 0288-cluster-ec-Fix-coverity-issues.patch
|
||||
Patch0289: 0289-cluster-ec-quorum-count-implementation.patch
|
||||
Patch0290: 0290-glusterd-tag-disperse.quorum-count-for-31306.patch
|
||||
Patch0291: 0291-cluster-ec-Mark-release-only-when-it-is-acquired.patch
|
||||
Patch0292: 0292-rpc-Update-address-family-if-it-is-not-provide-in-cm.patch
|
||||
Patch0293: 0293-glusterd-IPV6-hostname-address-is-not-parsed-correct.patch
|
||||
Patch0294: 0294-eventsapi-Set-IPv4-IPv6-family-based-on-input-IP.patch
|
||||
Patch0295: 0295-ctime-rebalance-Heal-ctime-xattr-on-directory-during.patch
|
||||
Patch0296: 0296-glusterfind-pre-command-failure-on-a-modify.patch
|
||||
Patch0297: 0297-rpmbuild-fixing-the-build-errors-with-2a905a8ae.patch
|
||||
|
||||
%description
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
@ -1466,6 +1479,9 @@ exit 0
|
||||
%{_datadir}/glusterfs/scripts/post-upgrade-script-for-quota.sh
|
||||
%{_datadir}/glusterfs/scripts/pre-upgrade-script-for-quota.sh
|
||||
%endif
|
||||
%{_datadir}/glusterfs/scripts/identify-hangs.sh
|
||||
%{_datadir}/glusterfs/scripts/collect-system-stats.sh
|
||||
%{_datadir}/glusterfs/scripts/log_accounting.sh
|
||||
# xlators that are needed on the client- and on the server-side
|
||||
%dir %{_libdir}/glusterfs
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}
|
||||
@ -1711,6 +1727,8 @@ exit 0
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%files server
|
||||
%doc extras/clear_xattrs.sh
|
||||
%{_datadir}/glusterfs/scripts/xattr_analysis.py*
|
||||
%{_datadir}/glusterfs/scripts/quota_fsck.py*
|
||||
# sysconf
|
||||
%config(noreplace) %{_sysconfdir}/glusterfs
|
||||
%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
@ -2301,6 +2319,10 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Sep 20 2019 Sunil Kumar Acharya <sheggodu@redhat.com> - 6.0-14
|
||||
- fixes bugs bz#1719171 bz#1728673 bz#1731896 bz#1732443 bz#1733970
|
||||
bz#1745107 bz#1746027 bz#1748688 bz#1750241 bz#1572163
|
||||
|
||||
* Fri Aug 23 2019 Rinku Kothiya <rkothiya@redhat.com> - 6.0-13
|
||||
- fixes bugs bz#1729915 bz#1732376 bz#1743611 bz#1743627 bz#1743634 bz#1744518
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user