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
Adopt device type #167
Adopt device type #167
Changes from all commits
6e6fa72
fc8e161
c68746d
f7c8620
251ae9e
476fa06
00ab48e
ff62e8f
8436d39
aa43265
be41347
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.
I understand if chunk_size is specified, HS starts from 0 num_chunks, but how does it know how many chunks has been created in total, and what is the available number chunks this LOG service can use, is there a place we assert that the total number chunks created is less than 64K (this is that FIXME you've put in creaet_vdev, right?).
I did some calculation, say one NVME drive is 500GB, 45% is around 200GB and it will require 6400 number of chunks with 32MB chunk size. 6400 + 64 + 128 + 65000 will exceed 64K, right? Please correct me if I missed something here.
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.
yes this is very tricky part. The log device go with chunk_size and it creates chunk dynamically, so worth case it could create
FAST_SIZE * PCT / CHUNK_SIZE
. But we dont know have the intelligent to distribute #chunks across service, that is part of the fixme.For the configuration now I tend to believe the behavior will be only 344 chunks is availalbe for log, bounding max logstore size to 344*32MB = 11G.
I will reduce the 65000 to 60000 for now. Other enhancement can be taken care later.
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.
So the ideal solution (with your change, in homestore) seems to be, log device should use that chunk_size, and num_chunks should not exceeding the total 64K, regardless of the pct set for this log service. This will result in losing some space not being used, better than creating chunk numbers that will overflow the chunk number and cause correctness issues.
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.
yes I think we need to change the log vdev , when creating a
max_num_chunks
parameterscan be provided and logstore need to stay within the limit to avoid create_chunk failure, also ensure flushing/truncating the logdev properly based on themax_num_chunks
. Logstore can take this chance to decide whether it want to adjust the chunk_size.There will not be correctness issue as in pdev::create_chunk , it will throw
std::out_of_range
but that probably crash the process. https://github.com/eBay/HomeStore/blob/2c500c573fa2c5733218e0cbdd44226fb3e6504f/src/lib/device/physical_dev.cpp#L275