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

map#clear causes all near-caches eventually drop all items #19501

Closed
uron86 opened this issue Sep 9, 2021 · 2 comments · Fixed by #19523
Closed

map#clear causes all near-caches eventually drop all items #19501

uron86 opened this issue Sep 9, 2021 · 2 comments · Fixed by #19523
Assignees
Milestone

Comments

@uron86
Copy link

uron86 commented Sep 9, 2021

According to this message, I create an issue for this bug :

Description of the bug
map#clear causes all near-caches eventually drop all items

Expected behavior
map#clear must evict all items only on the near-cache of the map we cleared

To Reproduce
Here is the scenario of reproduction :

  • I made a simple springboot application containing two Hazelcast IMap (itemsById and resourcesById)
  • These two caches are set as NearCache (in CacheConfig)
  • There is an endpoint Rest (endpoint GET available at http: // localhost: 8080 / demo) which performs the following actions :
    • Create an Item and load it into the IMap itemsById
    • Read this item in order to load it in the NearCache
    • In the process, second reading of this item => We can see that the item is in the NearCache (System.out in ItemByIdCache.getItem)
    • Clear of the second IMap (resourcesById)
    • In maximum one minute, the NearCache of the other cache (itemsById) is evicted
    • Finally, access to the item in the itemsById IMap to validate that the item is no longer in the NearCache
  • Complementary point on a second scenario: if the IMap resourcesById is not configured as Near Cache, the Near Cache of itemsById is not cleared.

Zip file of this demo project as well as the configuration file used on the Hazelcast node are available on the google group.

To validate the regression that appeared between version 3.9.4 and version 4.1.1, I'm also attaching (with the same link) another demo project (with the configuration file for the Hazelcast node as well) in version 3.9.4. The only difference in this project is that I wait 10 minutes (instead of one) after the resourcesById.clear to demonstrate that the Near Cache is not cleared.

@mmedenjak
Copy link
Contributor

Now that both PRs have been merged, can we close this issue @ahmetmircik ?

@ahmetmircik
Copy link
Member

closed via #19515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants