Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
SDSTOR-11579. expose chunk and chunkSelector Header #157
SDSTOR-11579. expose chunk and chunkSelector Header #157
Changes from all commits
1a0db6d
30232dc
68d6fd7
bf6004f
38d5399
87070a1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hkadayam This is dangerous as raw ptr/shared ptr are mixed used.
The cshare was born in
PhysicalDev::create_chunks
and all the way pass to chunkSelector, however the consumer part(allocator, etc) use raw ptr get from the cshare.It is functioning fine as a reference to every chunk was kept at
m_chunks_map
but it is a bad practice. Maybe lets have a ticket to move those *chunk to cshare ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this change of doing a .get() and select_chunk() returning a shared_ptr. Why incrementing atomic reference when all you are doing is accessing an in-memory member. I am not asking to change now, but will change in next PR.
I would rather return a chunk_id and look it up on the all chunks in vdev. If vdev doesn't maintain all chunks, then I would rather ask it to return a reference to chunks. This is a critical path for homestore, don't want unneccessary atomic reference increment and decrements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the upstream (PhysicalDev::create_chunks ) use shared_ptr, if we dont want ref counting we can change the interface of add/select to ref/raw_ptr. It could work as pdev holds the shared_ptr that ensuring the chunks will not be de-construct, just not safe.