[
https://issues.jboss.org/browse/ISPN-1673?page=com.atlassian.jira.plugin....
]
Vladimir Blagojevic commented on ISPN-1673:
-------------------------------------------
Galder, this is working as expected. We can not have exact number of cache entries as
specified by maxEntries but strictly less. The reason for this is that we currently do
eviction on Segment level. And therefore upon cache#put if a certain key hashes to a
Segment that is already full we do eviction on that Segment. I suggested that we close
this issue and note it as a known limitation!
Max entries logic broken
------------------------
Key: ISPN-1673
URL:
https://issues.jboss.org/browse/ISPN-1673
Project: Infinispan
Issue Type: Bug
Components: Eviction
Affects Versions: 5.1.0.CR2
Reporter: Galder ZamarreƱo
Assignee: Vladimir Blagojevic
Priority: Blocker
Fix For: 5.1.0.CR3
The following test:
{code}@Test(groups = "functional", testName =
"eviction.MaxEntriesTest")
public class MaxEntriesTest extends SingleCacheManagerTest {
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
ConfigurationBuilder builder =
TestCacheManagerFactory.getDefaultCacheConfiguration(false);
builder.eviction().maxEntries(4).strategy(EvictionStrategy.FIFO).build();
return new DefaultCacheManager(builder.build());
}
public void test000() {
cache.put(1, "1");
assert cache.size() == 1;
cache.put(2, "2");
assert cache.size() == 2;
cache.put(3, "3");
assert cache.size() == 3 : "Size is: " + cache.size();
}
}{code}
Fails with:
{code}java.lang.AssertionError: Size is: 2{code}
@Vladimir, is this related to some of your container changes?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira