summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2020-03-10 21:06:20 +0530
committerSunny Kumar <sunkumar@redhat.com>2020-03-12 11:27:16 +0000
commit75691851391694d27ad5dcb797df8d4a82fd9e2d (patch)
tree6ffe56158266d186c34efc608deb6e7ca6910c00 /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parent131d24d0c06ca82015256b98695421e09d27304a (diff)
downloadglusterfs-75691851391694d27ad5dcb797df8d4a82fd9e2d.tar.gz
glusterfs-75691851391694d27ad5dcb797df8d4a82fd9e2d.tar.xz
glusterfs-75691851391694d27ad5dcb797df8d4a82fd9e2d.zip
glusterd/snapshot: Add a warning message when a volume config changes
While changing a volume configuration, there is a chance that the brick layout on the disk might be changed. If snapshot is present on such volumes that will effects it's working. So this patch adds a warning message if snapshot is present while a volume config change happen. Change-Id: I7256863fef734841fce0bc9ad94d5d201b1813d5 Fixes: bz#1812144 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index a861240da3..3d13ef95ff 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -227,6 +227,18 @@ glusterd_op_stage_replace_brick(dict_t *dict, char **op_errstr,
is_force = _gf_true;
}
+ if (volinfo->snap_count > 0 || !cds_list_empty(&volinfo->snap_volumes)) {
+ snprintf(msg, sizeof(msg),
+ "Volume %s has %" PRIu64
+ " snapshots. "
+ "Changing the volume configuration will not effect snapshots."
+ "But the snapshot brick mount should be intact to "
+ "make them function.",
+ volname, volinfo->snap_count);
+ gf_msg("glusterd", GF_LOG_WARNING, 0, GD_MSG_SNAP_WARN, "%s", msg);
+ msg[0] = '\0';
+ }
+
ret = glusterd_get_dst_brick_info(&dst_brick, volname, op_errstr,
&dst_brickinfo, &host, dict,
&dup_dstbrick);