[
https://issues.apache.org/jira/browse/CASSANDRA-11168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176707#comment-15176707
]
Anubhav Kale commented on CASSANDRA-11168:
------------------------------------------
So, making sure I understand Aleksey's thought this correctly, what we want is
below. Can you confirm (only increment if hint window expired) ?
if (DatabaseDescriptor.hintedHandoffEnabled())
{
Set<String> disabledDCs =
DatabaseDescriptor.hintedHandoffDisabledDCs();
if (!disabledDCs.isEmpty())
{
final String dc =
DatabaseDescriptor.getEndpointSnitch().getDatacenter(ep);
if (disabledDCs.contains(dc))
{
Tracing.trace("Not hinting {} since its
data center {} has been disabled {}", ep, dc, disabledDCs);
return false;
}
}
boolean hintWindowExpired =
Gossiper.instance.getEndpointDowntime(ep) >
DatabaseDescriptor.getMaxHintWindow();
if (hintWindowExpired)
{
HintsService.instance.metrics.incrPastWindow(ep);
Tracing.trace("Not hinting {} which has been
down {} ms", ep, Gossiper.instance.getEndpointDowntime(ep));
}
return !hintWindowExpired;
}
else
{
return false;
}
> Hint Metrics are updated even if hinted_hand-offs=false
> -------------------------------------------------------
>
> Key: CASSANDRA-11168
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11168
> Project: Cassandra
> Issue Type: Bug
> Reporter: Anubhav Kale
> Assignee: Anubhav Kale
> Priority: Minor
> Attachments: 0001-Hinted-Handoff-Fix.patch
>
>
> In our PROD logs, we noticed a lot of hint metrics even though we have
> disabled hinted handoffs.
> The reason is StorageProxy.ShouldHint has an inverted if condition.
> We should also wrap the if (hintWindowExpired) block in if
> (DatabaseDescriptor.hintedHandoffEnabled()).
> The fix is easy, and I can provide a patch.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)