From 312b339190b7b8f2e38cdd210bf2ee71e53b287e Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 3 Sep 2014 10:50:31 +0530 Subject: glusterd: Prevent rebalance starting with old clients Glusterd will prevent rebalance from starting when clients older than glusterfs-v3.6.0 are connected to a volume. This is needed as running rebalance with old clients connected could lead to data loss in some cases. The DHT xlator on newer clients (>= 3.6.0) has been fixed to prevent the data loss issues. Change-Id: If58640236382a2fc13f73f6b43777f01713859f7 BUG: 1136201 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/8583 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index efaefe7b761..951e733b4db 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1577,6 +1577,25 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) goto out; } + /* Check if the connected clients are all of version + * glusterfs-3.6 and higher. This is needed to prevent some data + * loss issues that could occur when older clients are connected + * when rebalance is run. + */ + ret = glusterd_check_client_op_version_support + (volname, GD_OP_VERSION_3_6_0, NULL); + if (ret) { + ret = gf_asprintf (op_errstr, "Volume %s has one or " + "more connected clients of a version" + " lower than GlusterFS-v3.6.0. " + "Starting remove-brick in this state " + "could lead to data loss.\nPlease " + "disconnect those clients before " + "attempting this command again.", + volname); + goto out; + } + if (is_origin_glusterd (dict)) { ret = glusterd_generate_and_set_task_id (dict, GF_REMOVE_BRICK_TID_KEY); -- cgit