summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/nsr-server/src/recon_notify.c
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-03-31 18:37:38 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-04-22 15:20:46 +0000
commit46d333783a968ab39e0beade9c7a1eec8035f8b1 (patch)
treefaf1db8cb7ea7fefb0a4d8374440fa095116fef1 /xlators/cluster/nsr-server/src/recon_notify.c
parentacd2292f085b15c2c5c28169d11f20dca90f5ec9 (diff)
nsr: add quorum enforcement
Change-Id: I0241f8c1ac97c80ae438e3d9f1ac492d63da9347 Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/nsr-server/src/recon_notify.c')
-rw-r--r--xlators/cluster/nsr-server/src/recon_notify.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/cluster/nsr-server/src/recon_notify.c b/xlators/cluster/nsr-server/src/recon_notify.c
index 24f7cf2de..1c50de234 100644
--- a/xlators/cluster/nsr-server/src/recon_notify.c
+++ b/xlators/cluster/nsr-server/src/recon_notify.c
@@ -91,8 +91,14 @@ nsr_recon_set_leader (xlator_t *this)
if (ctx->last_reconciled_term == priv->current_term)
return;
- // No majority as of yet
- if (priv->up_children <= (priv->n_children / 2))
+ /*
+ * Quorum for reconciliation is not the same as quorum for I/O. Here,
+ * we require a true majority. The +1 is because we don't count
+ * ourselves as part of n_children or up_children.
+ *
+ * TBD: re-evaluate when to reconcile (including partial)
+ */
+ if (priv->up_children <= (priv->n_children / 2))
return;
gf_log (this->name, GF_LOG_INFO,