summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-08-12 04:14:21 +0530
committerVijay Bellur <vbellur@redhat.com>2014-09-23 03:13:25 -0700
commit274f1c4f522a7df1df77431007a35e4dff7f6a47 (patch)
tree667953ffcdacdf82b6dd00d6ede5730d77b2151a
parentf46f406d3b010fd0ad1a03d5cfe1658904967be0 (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: 1145091 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> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8804
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c12
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 062007889ab..7c697d1912e 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),