Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMap nearCache sets its maxSize to 10_000 even configured EvictionPolicy is NONE #18812

Closed
ahmetmircik opened this issue May 31, 2021 · 1 comment
Assignees
Milestone

Comments

@ahmetmircik
Copy link
Member

ahmetmircik commented May 31, 2021

seen it here: https://hazelcastcommunity.slack.com/archives/C015Q2TUBKL/p1622165005067600?thread_ts=1622146957.063200&cid=C015Q2TUBKL

This is a missing piece of the change here: #18348

 @Test
    public void near_cache_size_equals_map_size_when_eviction_policy_is_none() {
        NearCacheConfig nearCacheConfig = new NearCacheConfig();
        nearCacheConfig.setCacheLocalEntries(true);
        nearCacheConfig.getEvictionConfig().setEvictionPolicy(EvictionPolicy.NONE);

        Config config = getConfig();
        config.getMapConfig("test").setNearCacheConfig(nearCacheConfig);

        HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
        IMap<Object, Object> map = hazelcastInstance.getMap("test");

        // populate map
        int mapSize = 99_999;
        for (int i = 0; i < mapSize; i++) {
            map.set(i, i);
        }

        // populate near-cache
        for (int i = 0; i < mapSize; i++) {
            map.get(i);
        }

        assertEquals(mapSize, map.getLocalMapStats()
                .getNearCacheStats().getOwnedEntryCount());
    }

The versions affected are: versions >= 3.12.3 and all minor versions of 4

@ahmetmircik
Copy link
Member Author

closed by #18813

@mmedenjak mmedenjak added Source: Community PR or issue was opened by a community user Team: Core labels Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants