diff options
author | Kotresh HR <khiremat@redhat.com> | 2015-01-06 20:26:39 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-02-16 04:22:18 -0800 |
commit | 8618abaaf07a96c0384db9bd1e7dbbe663f4f24c (patch) | |
tree | 8982056824e7e084f84e2a6bfebdf8e7ac8ca5cd /xlators/mgmt/glusterd/src/glusterd-brick-ops.c | |
parent | 04c4ec96b88ee6392812a511de32b48bbe63a421 (diff) | |
download | glusterfs-8618abaaf07a96c0384db9bd1e7dbbe663f4f24c.tar.gz glusterfs-8618abaaf07a96c0384db9bd1e7dbbe663f4f24c.tar.xz glusterfs-8618abaaf07a96c0384db9bd1e7dbbe663f4f24c.zip |
glusterd/geo-rep: Allow replace/remove brick if geo-rep is stopped.
Replace brick:
If geo-replication was configured on a volume, replace brick
used to fail. This patch allows replace brick to go through
if all geo-rep sessions corresponding to that volume is stopped.
Remove brick:
There was no check for geo-replication for remove brick. Enforce
'remove brick commit' to fail if geo-rep session corresponding
to volume is running. Allow 'remove brick commit' only if all of
the geo-rep sessions corresponding to that volume is stopped.
Code is re-organized for better readability.
Change-Id: I02282c2764d8b81e319489c977847e6e437511a4
BUG: 1179638
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/9402
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: ajeet jha <ajha@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 951e733b4d..72aaff58ff 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -17,6 +17,7 @@ #include "xdr-generic.h" #include "glusterd.h" #include "glusterd-op-sm.h" +#include "glusterd-geo-rep.h" #include "glusterd-store.h" #include "glusterd-utils.h" #include "glusterd-volgen.h" @@ -1467,6 +1468,7 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) char key[256] = {0,}; char *brick = NULL; glusterd_brickinfo_t *brickinfo = NULL; + gsync_status_param_t param = {0,}; this = THIS; GF_ASSERT (this); @@ -1658,6 +1660,16 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) } } + /* If geo-rep is configured, for this volume, it should be + * stopped. + */ + param.volinfo = volinfo; + ret = glusterd_check_geo_rep_running (¶m, op_errstr); + if (ret || param.is_active) { + ret = -1; + goto out; + } + break; case GF_OP_CMD_COMMIT_FORCE: |