From 6f6744730e34fa8a161b5f7f2a8ad3f8a7fc30fa Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 4 Apr 2013 19:35:11 -0700 Subject: afr: let eager-locking do its own overlap checks Today there is a non-obvious dependence of eager-locking on write-behind. The reason is that eager-locking works as long as the inheriting transaction has no overlaps with any of the transactions already in progress. While write-behind provides non-overlapping writes as a side-effect most of times (and only guarantees it when strict-write-ordering option is enabled, which is not on by default) eager-lock needs the behavior as a guarantee. This is leading to complex and unwanted checks for the presence of write-behind in the graph, for the simple task of checking for overlaps. This patch removes the interdependence between eager-locking and write-behind by making eager-locking do its own overlap checks with in-progress writes. Change-Id: Iccba1185aeb5f1e7f060089c895a62840787133f BUG: 912581 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/4782 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 54 ----------------------------- 1 file changed, 54 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 53963989..03bcb44a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3440,56 +3440,6 @@ out: return ret; } -int -validate_wb_eagerlock (glusterd_volinfo_t *volinfo, dict_t *val_dict, - char **op_errstr) -{ - int ret = -1; - gf_boolean_t wb_val = _gf_false; - gf_boolean_t el_val = _gf_false; - char msg[2048] = {0}; - char *wb_key = NULL; - char *el_key = NULL; - - wb_key = "performance.write-behind"; - el_key = "cluster.eager-lock"; - ret = dict_get_str_boolean (val_dict, wb_key, -1); - if (ret < 0) - goto check_eager_lock; - wb_val = ret; - ret = glusterd_volinfo_get_boolean (volinfo, el_key); - if (ret < 0) - goto out; - el_val = ret; - goto done; - -check_eager_lock: - ret = dict_get_str_boolean (val_dict, el_key, -1); - if (ret < 0) { - ret = 0; //Keys of intereset to this fn are not present. - goto out; - } - el_val = ret; - ret = glusterd_volinfo_get_boolean (volinfo, wb_key); - if (ret < 0) - goto out; - wb_val = ret; - goto done; - -done: - ret = 0; - if (!wb_val && el_val) { - ret = -1; - snprintf (msg, sizeof (msg), "%s off and %s on is not " - "valid configuration", wb_key, el_key); - gf_log ("glusterd", GF_LOG_ERROR, "%s", msg); - if (op_errstr) - *op_errstr = gf_strdup (msg); - goto out; - } -out: - return ret; -} int validate_clientopts (glusterd_volinfo_t *volinfo, @@ -3650,10 +3600,6 @@ glusterd_validate_reconfopts (glusterd_volinfo_t *volinfo, dict_t *val_dict, goto out; } - ret = validate_wb_eagerlock (volinfo, val_dict, op_errstr); - if (ret) - goto out; - ret = validate_clientopts (volinfo, val_dict, op_errstr); if (ret) { gf_log ("", GF_LOG_DEBUG, -- cgit