summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Vigor <kvigor@fb.com>2017-01-04 16:29:23 -0800
committerKevin Vigor <kvigor@fb.com>2017-01-04 17:03:03 -0800
commit63403742f53ec59a6acbe26ff4c39bab1b0842ed (patch)
tree2c35221629def5e553caa957152ca5db72e59c65
parent1e69c7ef96a92754d4394fe2cff8767d3b1809fa (diff)
Another shot at stablizing halo prove tests
Summary: This time for sure! Changeset 7a6ead5 introduced a bug which allowed halo to exceed the halo-max-replicas setting; the setting is only honored once halo-min-samples pings have been received. This is fixed by using the global halo-enabled flag when enforcing halo-max-replicas. The remainder of this changeset is enhanced debugs. Test Plan: prove tests/basic/halo* Reviewers: Subscribers: Tasks: Blame Revision: Change-Id: I8231a6c66f2c620d99e3418ed0eca757d50f085a Signed-off-by: Kevin Vigor <kvigor@fb.com> Reviewed-on: http://review.gluster.org/16326 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Shreyas Siravara <sshreyas@fb.com> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/cluster/afr/src/afr-common.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index d5002a2070b..6431432690d 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4452,6 +4452,17 @@ find_worst_up_child (xlator_t *this)
return worst_child;
}
+static const char *halo_state_str(int i)
+{
+ switch (i) {
+ case 0: return "DOWN";
+ case 1: return "UP";
+ }
+
+ return "unknown";
+}
+
+
static void dump_halo_states (xlator_t *this) {
afr_private_t *priv = NULL;
int i = -1;
@@ -4463,14 +4474,12 @@ static void dump_halo_states (xlator_t *this) {
gf_log (this->name, GF_LOG_DEBUG,
"Child %d halo state: %s (N/A)",
i,
- priv->child_up[i] ? CHILD_UP_STR :
- CHILD_DOWN_STR);
+ halo_state_str(priv->child_up[i]));
} else {
gf_log (this->name, GF_LOG_DEBUG,
"Child %d halo state: %s (%"PRIi64" ms)",
i,
- priv->child_up[i] ? CHILD_UP_STR :
- CHILD_DOWN_STR,
+ halo_state_str(priv->child_up[i]),
priv->child_latency[i]);
}
}
@@ -4510,6 +4519,16 @@ _afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
latency_samples, priv->halo_min_samples);
}
+ gf_log (this->name, GF_LOG_DEBUG,
+ "ping: child %u (%s) latency %"PRIu64" ms (max %"PRIu64" ms)"
+ " up_count %d (min %d) enabled %s",
+ idx, child_xlator ? child_xlator->name : "<null>",
+ *child_latency_msec,
+ halo_max_latency_msec,
+ up_children,
+ priv->halo_min_replicas,
+ child_halo_enabled ? "true" : "false");
+
/*
* Case 1: This child's latency exceeds the maximum allowable
* for this halo.
@@ -4648,7 +4667,7 @@ _afr_handle_child_up_event (xlator_t *this, xlator_t *child_xlator,
goto out;
}
}
- if (child_halo_enabled == _gf_true &&
+ if (priv->halo_enabled &&
up_children > priv->halo_max_replicas &&
!priv->shd.iamshd) {
if (was_down == _gf_true)