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

Support flexible virtual device creation in HomeStore with num_chunks or chunk_size #597

Merged

Conversation

Hooper9973
Copy link
Contributor

@Hooper9973 Hooper9973 commented Nov 26, 2024

Support flexible virtual device creation in homestore::BlkDataService with num_chunks or chunk_size. Prioritize num_chunks over chunk_size if both are provided.

@Hooper9973 Hooper9973 force-pushed the support_start_hs_repl_dev_with_chunk_size branch 2 times, most recently from 07ae974 to 85b8ac6 Compare November 26, 2024 06:36
@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.64%. Comparing base (1a0cef8) to head (b352f3f).
Report is 96 commits behind head on master.

❗ 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.
📢 Have feedback on the report? Share it here.

@@ -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,
Copy link
Collaborator

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

Copy link
Contributor Author

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

fparams.dev_type, fparams.block_size, fparams.alloc_type,
fparams.chunk_sel_type,
fparams.num_chunks);
} else if (fparams.chunk_size != 0) {
Copy link
Contributor

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@Hooper9973 Hooper9973 force-pushed the support_start_hs_repl_dev_with_chunk_size branch from 85b8ac6 to 757f651 Compare November 29, 2024 08:45
…e` with num_chunks or chunk_size.

Prioritize `num_chunks` over `chunk_size` if both are provided.
@Hooper9973 Hooper9973 force-pushed the support_start_hs_repl_dev_with_chunk_size branch from 757f651 to b352f3f Compare November 29, 2024 10:57
@Hooper9973 Hooper9973 merged commit 7811855 into eBay:master Nov 30, 2024
21 checks passed
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.

4 participants