summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2019-09-05 16:12:39 +0530
committerPranith Kumar K <pkarampu@redhat.com>2019-09-08 09:09:52 +0530
commitea95631ff47c8048f039faedbc0faa918c4e165a (patch)
tree5442f13643bb637dc7011617815b726362a8bc2d /xlators/cluster/ec/src/ec-common.c
parent6bf09ecbe8203d0f8c020e6b0b55202e91e216c9 (diff)
cluster/ec: quorum-count implementation
fixes: #721 Change-Id: I5333540e3c635ccf441cf1f4696e4c8986e38ea8 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-common.c')
-rw-r--r--xlators/cluster/ec/src/ec-common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index e243b8b..dea987e 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -707,6 +707,19 @@ ec_child_select(ec_fop_data_t *fop)
return 0;
}
+ if (!fop->parent && fop->lock_count &&
+ (fop->locks[0].update[EC_DATA_TXN] ||
+ fop->locks[0].update[EC_METADATA_TXN])) {
+ if (ec->quorum_count && (num < ec->quorum_count)) {
+ gf_msg(ec->xl->name, GF_LOG_ERROR, 0, EC_MSG_CHILDS_INSUFFICIENT,
+ "Insufficient available children "
+ "for this request (have %d, need "
+ "%d). %s",
+ num, ec->quorum_count, ec_msg_str(fop));
+ return 0;
+ }
+ }
+
return 1;
}