From 8a45a0e480f7e8c6ea1195f77ce3810d4817dc37 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 3 Apr 2012 15:37:25 +0530 Subject: glusterd: Added volume-id to 'op' dictionary Volume-id passed in op dictionary would help detect possible split brains among peers in a cluster. The idea is to check if the volume's id and the vol-id that was passed are equal. ie, same volume name, but different volume id indicate that glusterd 'metadata' of one of the participating peers is stale or there is a split brain. This is over and above the existing checksum based validation of peer supplied cluster 'metadata' (ie, volume info file). Change-Id: I1049ef249e417e540ccb4243e450f92fcd0f46f9 BUG: 797734 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/3083 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 8 ++++++++ 1 file changed, 8 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 aa57341ff..300c40a8d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1065,6 +1065,10 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr) goto out; } + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + if (glusterd_is_rb_ongoing (volinfo)) { snprintf (msg, sizeof (msg), "Replace brick is in progress on " "volume %s. Please retry after replace-brick " @@ -1201,6 +1205,10 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) goto out; } + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + if (glusterd_is_rb_ongoing (volinfo)) { snprintf (msg, sizeof (msg), "Replace brick is in progress on " "volume %s. Please retry after replace-brick " -- cgit