summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorRichard Wareing <rwareing@fb.com>2015-06-10 21:39:11 -0700
committerShreyas Siravara <sshreyas@fb.com>2016-12-29 08:54:58 -0800
commit0658050cc6bd2b3e5b9515a35055287ad59f3796 (patch)
treef9c76a81f2224d5fb30637777f0ed96ae1f08a3f /xlators/cluster/afr/src
parent7a6ead5c03e9f62fe8726b141c94cc7d31a79c39 (diff)
Fix Halo tests in v3.6.3 of GlusterFS + minor SHD bug fix
Summary: - SHD is now excluded from the max-replicas policy. We'd need to make an SHD specific tunable for this to make tests reliably pass, and frankly it probably makes things more intuitive having SHD excluded (i.e. SHD can always see everything). - Updated the halo-failover-enabled test, I think it's a bit more clear now, and works reliably. halo.t fixed after fixing the SHD max-replicas bug. Test Plan: - Run prove tests -> https://phabricator.fb.com/P19872728 Reviewers: dph, sshreyas Reviewed By: sshreyas FB-commit-id: e425e6651cd02691d36427831b6b8ca206d0f78f Change-Id: I57855ef99628146c32de59af475b096bd91d6012 Signed-off-by: Kevin Vigor <kvigor@fb.com> Reviewed-on: http://review.gluster.org/16305 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shreyas Siravara <sshreyas@fb.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-common.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 8e46117b025..c4b6fd6a9b6 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4253,6 +4253,21 @@ find_worst_up_child (xlator_t *this)
return worst_child;
}
+static void dump_halo_states (xlator_t *this) {
+ afr_private_t *priv = NULL;
+ int i = -1;
+
+ priv = this->private;
+
+ for (i = 0; i < priv->child_count; i++) {
+ 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,
+ priv->child_latency[i]);
+ }
+}
+
static void
_afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
const int idx, const int64_t halo_max_latency_msec,
@@ -4264,7 +4279,6 @@ _afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
int up_children = 0;
int best_down_child = 0;
uint64_t latency_samples = 0;
- char *child_state_str = NULL;
priv = this->private;
@@ -4276,13 +4290,7 @@ _afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
for (i = 0; i < priv->child_count; i++) {
if (priv->child_up[i] == 1) {
up_children++;
- child_state_str = CHILD_UP_STR;
- } else {
- child_state_str = CHILD_DOWN_STR;
}
- gf_log (child_xlator->name, GF_LOG_DEBUG,
- "Child %d halo state: %s (%"PRIi64"ms)",
- i, child_state_str, priv->child_latency[i]);
}
/* Don't do anything until you have some minimum numbner of
@@ -4340,6 +4348,7 @@ _afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
* Case 3: Child latency is within halo,and currently marked up,
* mark it down if it's the highest latency child and the
* number of up children is greater than halo_max_replicas.
+ * UNLESS you are an SHD in which case do nothing.
*/
} else if ((child_halo_enabled == _gf_true &&
*child_latency_msec <= halo_max_latency_msec) &&
@@ -4358,6 +4367,12 @@ _afr_handle_ping_event (xlator_t *this, xlator_t *child_xlator,
*event = GF_EVENT_CHILD_DOWN;
}
}
+
+ if (*event != GF_EVENT_CHILD_PING &&
+ gf_log_get_loglevel () >= GF_LOG_DEBUG) {
+ gf_log (this->name, GF_LOG_DEBUG, "Initial halo states:");
+ dump_halo_states (this);
+ }
}
void
@@ -4457,6 +4472,11 @@ out:
}
priv->last_event[idx] = *event;
+
+ if (gf_log_get_loglevel () >= GF_LOG_DEBUG) {
+ gf_log (this->name, GF_LOG_DEBUG, "New halo states:");
+ dump_halo_states (this);
+ }
}
void
@@ -4551,6 +4571,11 @@ _afr_handle_child_down_event (xlator_t *this, xlator_t *child_xlator,
*event = GF_EVENT_CHILD_MODIFIED;
}
priv->last_event[idx] = *event;
+
+ if (gf_log_get_loglevel () >= GF_LOG_DEBUG) {
+ gf_log (this->name, GF_LOG_DEBUG, "New halo states:");
+ dump_halo_states (this);
+ }
}
int64_t