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

Reset item in case of reserve #47

Merged
merged 2 commits into from
Aug 22, 2019
Merged

Conversation

michalbiesek
Copy link

@michalbiesek michalbiesek commented Jul 17, 2019

  • item could be reserved but not inserted yet in database e.g. during
    partial request

Ref: #42 (comment)


This change is Reviewable

@jschmieg
Copy link

jschmieg commented Aug 6, 2019

A situation when item X is reserved and item X+1 (next one) is linked will cause item X leak after startup because next_item_in_slab pointer will skip reserved item X.

@michalbiesek michalbiesek force-pushed the slab-reserve branch 2 times, most recently from 8ee2afb to 13b1714 Compare August 20, 2019 11:54
@michalbiesek
Copy link
Author

@jschmieg please look for this now

@michalbiesek michalbiesek force-pushed the slab-reserve branch 2 times, most recently from 7fbce6f to c518b2d Compare August 21, 2019 12:11
@@ -189,6 +189,9 @@ _slab_recreate_items(struct slab *slab)
}
} else if (it->in_freeq) {
_slab_put_item_into_freeq(it, slab->id);
} else if ((it->klen ) && (it->vlen == 0)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(it->klen ) -> (it->klen)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove brackets to be inline with rest of the code

michalbiesek added 2 commits August 22, 2019 14:00
- in case of reserve item and restart db item would be release
- test_evict_refcount remove one reset where reserved item is deleted
@michalbiesek michalbiesek merged commit e84e4c7 into pmem:master Aug 22, 2019
@michalbiesek michalbiesek deleted the slab-reserve branch August 22, 2019 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants