diff options
| author | Kaushik BV <kaushikbv@gluster.com> | 2011-04-18 08:49:54 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-04-19 02:29:40 -0700 | 
| commit | 94d32434fdb1d7fc333ab9bf4bf8d3a4eb0dff9e (patch) | |
| tree | 2d61391b764e5b731273f0acf82cc65cf2c84862 | |
| parent | e89f2a1f5daf1513c533a47b90aec8f90702d09f (diff) | |
mgmt/glusterd: do not allow replace-brick operations when geo-rep sessions are active on this volume.
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2765 (geo-replication should have mercy on brick failure)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2765
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 688fec15281..70fddf20521 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -838,6 +838,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,          char                                    *dup_dstbrick  = NULL;          glusterd_peerinfo_t                     *peerinfo = NULL;          glusterd_brickinfo_t                    *dst_brickinfo = NULL; +        gf_boolean_t                            is_run         = _gf_false;          ret = dict_get_str (dict, "src-brick", &src_brick); @@ -887,6 +888,23 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,                  goto out;          } +        ret = glusterd_check_gsync_running (volinfo, &is_run); +        if (ret && (is_run == _gf_false)) +                gf_log ("", GF_LOG_WARNING, "Unable to get the status" +                                " of active "GEOREP" session"); +        if (is_run) { +                gf_log ("", GF_LOG_WARNING, GEOREP" sessions active" +                        "for the volume %s ", volname); +                snprintf (msg, sizeof(msg), GEOREP" sessions are active " +                                "for the volume %s.\nStop "GEOREP "sessions " +                                "involved in this volume. Use 'volume "GEOREP +                                " status' command for more info.", +                                volname); +                *op_errstr = gf_strdup (msg); +                ret = -1; +                goto out; +        } +          if (glusterd_is_defrag_on(volinfo)) {                  snprintf (msg, sizeof(msg), "Volume name %s rebalance is in "                            "progress. Please retry after completion", volname);  | 
