[
https://issues.apache.org/jira/browse/CASSANDRA-19426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821497#comment-17821497
]
Maxwell Guo commented on CASSANDRA-19426:
-----------------------------------------
agree with [~brandon.williams], but it would be more perfect if there were some
test data on larger clusters such as 1000 nodes. Seems [~jjirsa] has made a
version of code modification, I don’t know if there is any test data.
> Fix Double Type issues in the Gossiper#maybeGossipToCMS
> -------------------------------------------------------
>
> Key: CASSANDRA-19426
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19426
> Project: Cassandra
> Issue Type: Improvement
> Components: Cluster/Gossip, Transactional Cluster Metadata
> Reporter: Ling Mao
> Assignee: Ling Mao
> Priority: Low
> Fix For: 5.x
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> _*issue-1:*_
> if liveEndpoints.size()=unreachableEndpoints.size()=0; probability will be
> {*}_Infinity_{*}.
> randDbl <= probability will always be true, then sendGossip
> _*issue-2:*_
> comparing two double is safe by using *<* or {*}>{*}. However missing
> accuracy will happen if we compare the equality of two double by
> intuition({*}={*}). For example:
> {code:java}
> double probability = 0.1;
> double randDbl = 0.10000000000000001; // Slightly greater than probability
> if (randDbl <= probability)
> {
> System.out.println("randDbl <= probability(always here)");
> }
> else
> {
> System.out.println("randDbl > probability");
> }
> {code}
> A good example from: _*Gossiper#maybeGossipToUnreachableMember*_
> {code:java}
> if (randDbl < prob)
> {
> sendGossip(message, Sets.filter(unreachableEndpoints.keySet(),
> ep ->
> !isDeadState(getEndpointStateMap().get(ep))));
> }{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]