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

Run forced eviction if map has eviction configured. #16085

Merged
merged 3 commits into from Nov 26, 2019

Conversation

@ahmetmircik
Copy link
Member

ahmetmircik commented Nov 22, 2019

Issue:
We should run forced eviction only if a map has eviction configured. Otherwise, it shouldn't run and should throw Native OOME. In current form, forced eviction is evicting all entries regardless of the eviction configuration.

Reasoning for the fix:
Effectively we have 1 type of forced eviction strategy and it is based on to evict a percentage of entries. So far forced eviction first tries to evict 20 percent of entries then if it still gets Native OOME, it retries by evicting 100 percent of entries by using evictAll method.

Changes:
Based on the reasoning, refactored forced eviction code that we only have SingleRecordStoreForcedEviction and MultipleRecordStoreForcedEviction and made them work with any percentage. By default we have 2 values for percentages: 20 and 100. Removed other unneeded eviction strategies that are using evictAll.

*** Tests are in EE PR.
ee counterpart: hazelcast/hazelcast-enterprise#3382

@ahmetmircik ahmetmircik added this to the 4.0 milestone Nov 22, 2019
@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch from 9d030c3 to 0910868 Nov 22, 2019
@ahmetmircik ahmetmircik requested review from mmedenjak and vbekiaris Nov 22, 2019
@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch 3 times, most recently from d123f93 to e126e1f Nov 22, 2019
@ahmetmircik ahmetmircik changed the title Polish forced eviction code Run forced eviction if map has eviction configured. Nov 25, 2019
@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch 2 times, most recently from 7b8e8d2 to 15c0f54 Nov 25, 2019
@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch 2 times, most recently from c79e48a to fa4fbd8 Nov 25, 2019
Copy link
Contributor

vbekiaris left a comment

logic looks ok, some comments

@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch from a3d263a to 93bf472 Nov 25, 2019
@ahmetmircik ahmetmircik force-pushed the ahmetmircik:fix/4.0/polishForced branch from 93bf472 to a7b9ca5 Nov 26, 2019
@mmedenjak mmedenjak self-requested a review Nov 26, 2019
@ahmetmircik ahmetmircik merged commit ec64722 into hazelcast:master Nov 26, 2019
1 check passed
1 check passed
default Test PASSed.
Details
@ahmetmircik ahmetmircik deleted the ahmetmircik:fix/4.0/polishForced branch Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.