-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support flexible virtual device creation in HomeStore with num_chunks or chunk_size #597
Support flexible virtual device creation in HomeStore with num_chunks or chunk_size #597
Conversation
07ae974
to
85b8ac6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #597 +/- ##
===========================================
+ Coverage 56.51% 66.64% +10.13%
===========================================
Files 108 109 +1
Lines 10300 10770 +470
Branches 1402 1471 +69
===========================================
+ Hits 5821 7178 +1357
+ Misses 3894 2886 -1008
- Partials 585 706 +121 ☔ View full report in Codecov by Sentry. |
@@ -55,6 +55,24 @@ void BlkDataService::create_vdev(uint64_t size, HSDevType devType, uint32_t blk_ | |||
.context_data = vdev_ctx.to_blob()}); | |||
} | |||
|
|||
void BlkDataService::create_vdev_with_chunk_size(uint64_t size, HSDevType devType, uint32_t blk_size, blk_allocator_type_t alloc_type, |
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.
why we want separate function instead of passing both chunk_size and num_chunks in?
in create_vdev
we check one and only one is not zero
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.
pass both chunk_size and num_chunks with no check in creat_vdev
,
device_manager always prioritize num_chunks over chunk_size
PTAL
src/lib/homestore.cpp
Outdated
fparams.dev_type, fparams.block_size, fparams.alloc_type, | ||
fparams.chunk_sel_type, | ||
fparams.num_chunks); | ||
} else if (fparams.chunk_size != 0) { |
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.
when creating vdev, device_manager always prioritize num_chunks over chunk_size
HomeStore/src/lib/device/device_manager.cpp
Lines 243 to 244 in 6a2dfd8
if (vparam.num_chunks != 0) { | |
auto input_num_chunks = vparam.num_chunks; |
if we want to create vdev according to num_chunks , we set it to non-zero, otherwist, we set num_chunks to zero ,and set chunk_size to what we want
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.
good idea
85b8ac6
to
757f651
Compare
…e` with num_chunks or chunk_size. Prioritize `num_chunks` over `chunk_size` if both are provided.
757f651
to
b352f3f
Compare
Support flexible virtual device creation in
homestore::BlkDataService
with num_chunks or chunk_size. Prioritizenum_chunks
overchunk_size
if both are provided.