[
https://issues.jboss.org/browse/ISPN-6910?page=com.atlassian.jira.plugin....
]
Dan Berindei edited comment on ISPN-6910 at 8/12/16 8:07 AM:
-------------------------------------------------------------
[~rvansa] I guess it depends on what you expect {{MagicKey}} to do... if you want to
generate a few keys per test, and you only had a low number of nodes, the chances of
failing to generate a key are miniscule. I agree that the error message is pretty bad, but
almost every time when 1000 iterations are not enough, it means there's no segment
with the combination of owners you want.
If, however, you want to generate >10 keys, then I'd argue you don't really
want {{MagicKey}}. You'd be much better served by writing a custom
{{ConsistentHashFactory}} and/or {{KeyPartitioner}} that put every key in a particular
segment, and assign that segment to the intended owners.
was (Author: dan.berindei):
[~rvansa] I guess it depends on what you expect {{MagicKey}} to do... if you want to
generate a few keys per test, and you only had a low number of nodes, the chances of
failing to generate a key are miniscule. I agree that the error message is pretty bad, but
almost every when 1000 iterations are not enough, it means there's no segment with the
combination of owners you want.
If, however, you want to generate >10 keys, then I'd argue you don't really
want {{MagicKey}}. You'd be much better served by writing a custom
{{ConsistentHashFactory}} and/or {{KeyPartitioner}} that put every key in a particular
segment, and assign that segment to the intended owners.
Random failures due to MagicKey
-------------------------------
Key: ISPN-6910
URL:
https://issues.jboss.org/browse/ISPN-6910
Project: Infinispan
Issue Type: Enhancement
Components: Test Suite - Core
Affects Versions: 9.0.0.Alpha3
Reporter: Radim Vansa
Assignee: Radim Vansa
Fix For: 9.0.0.Beta1, 9.0.0.Final
There is a fixed 1000-iteration loop to find out proper key. In tests that create many
magic keys, the cumulative probability of failing one of the keys' generation is going
up and this is causing random failures in the testsuite.
Moreover, the equality of magic keys is based only on the hashCode - with many keys,
there is a non-trivial chance that the hashcodes will make two logically different keys
equal.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)