summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-11-14 12:08:23 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-14 10:26:48 -0800
commit22aa43c16357811f8218215d2f2f830005860c96 (patch)
treea0c8f57482d8e82308e08e9644310dd6f55cb4ad /xlators/mgmt
parent479393858a1744adf7c9f56216ca228b188a7398 (diff)
mgmt/glusterd: fixes for uninterrupted replace-brick with nfs
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2084 ([3.1.1qa5] : replace-brick fails to migrate data when migration from same hostname) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2084
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 62dd7fa90..4671aa8df 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -2045,11 +2045,18 @@ rb_src_brick_restart (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *src_brickinfo,
int activate_pump)
{
- int ret = 0;
+ int ret = 0;
gf_log ("", GF_LOG_DEBUG,
"Attempting to kill src");
+ ret = glusterd_nfs_server_stop ();
+
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "Unable to stop nfs, ret: %d",
+ ret);
+ }
+
ret = glusterd_volume_stop_glusterfs (volinfo, src_brickinfo);
if (ret) {
gf_log ("", GF_LOG_ERROR, "Unable to stop "
@@ -2084,8 +2091,12 @@ rb_src_brick_restart (glusterd_volinfo_t *volinfo,
goto out;
}
-
out:
+ ret = glusterd_nfs_server_start ();
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "Unable to start nfs, ret: %d",
+ ret);
+ }
return ret;
}
@@ -3055,12 +3066,6 @@ glusterd_op_replace_brick (gd1_mgmt_stage_op_req *req, dict_t *rsp_dict)
"Received commit - will be adding dst brick and "
"removing src brick");
- ret = glusterd_check_generate_start_nfs (volinfo);
- if (ret) {
- gf_log ("", GF_LOG_CRITICAL, "Failed to generate "
- " nfs volume file");
- }
-
if (!glusterd_is_local_addr (dst_brickinfo->hostname) &&
replace_op != GF_REPLACE_OP_COMMIT_FORCE) {
gf_log ("", GF_LOG_NORMAL,
@@ -3080,18 +3085,31 @@ glusterd_op_replace_brick (gd1_mgmt_stage_op_req *req, dict_t *rsp_dict)
}
+ ret = glusterd_nfs_server_stop ();
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "Unable to stop nfs"
+ "server, ret: %d", ret);
+ }
+
ret = glusterd_op_perform_replace_brick (volinfo, src_brick,
dst_brick);
if (ret) {
gf_log ("", GF_LOG_CRITICAL, "Unable to add "
"dst-brick: %s to volume: %s",
dst_brick, volinfo->volname);
+ (void) glusterd_check_generate_start_nfs (volinfo);
goto out;
}
volinfo->version++;
volinfo->defrag_status = 0;
+ ret = glusterd_check_generate_start_nfs (volinfo);
+ if (ret) {
+ gf_log ("", GF_LOG_CRITICAL, "Failed to generate "
+ " nfs volume file");
+ }
+
ret = glusterd_store_update_volume (volinfo);
if (ret)