diff options
| author | Sachin Pandit <spandit@redhat.com> | 2014-08-12 04:14:21 +0530 | 
|---|---|---|
| committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-08-21 23:57:11 -0700 | 
| commit | aa9b19e4b3329f446f0eb9b3a4ed0dbb9ebe4d09 (patch) | |
| tree | 1bd9281151a9578f7fea23859f2887dae21f0696 | |
| parent | 865d156d30498cd1bf4219ddbbb304d2ffd4aea0 (diff) | |
glusterd/snapshot : Fail the snapshot create operation if geo-rep is running.
As one of the recommandations for taking a snapshot is not to have
an active geo-replication session, its better to display an error
saying session is active when snapshot create command is issued.
Change-Id: I94593dbd2659610e033ca316176dda1ac8dc5ce6
BUG: 1129038
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8461
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 12 | 
1 files changed, 11 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index a86795e224e..09acb25c3f5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -1845,6 +1845,7 @@ glusterd_snapshot_create_prevalidate (dict_t *dict, char **op_errstr,                          loglevel = GF_LOG_WARNING;                          goto out;                  } +                  if (glusterd_is_defrag_on (volinfo)) {                          snprintf (err_str, sizeof (err_str),                                    "rebalance process is running for the " @@ -1852,7 +1853,16 @@ glusterd_snapshot_create_prevalidate (dict_t *dict, char **op_errstr,                          loglevel = GF_LOG_WARNING;                          goto out;                  } -                /* TODO: Also check whether geo replication is running */ + +                if (gd_vol_is_geo_rep_active (volinfo)) { +                         snprintf (err_str, sizeof (err_str), +                                   "geo-replication session is running for " +                                   "the volume %s. Session needs to be " +                                   "stopped before taking a snapshot.", +                                   volname); +                         loglevel = GF_LOG_WARNING; +                         goto out; +                }                  if (volinfo->is_snap_volume == _gf_true) {                          snprintf (err_str, sizeof (err_str),  | 
