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

Allowing consumer of HS specified device type for each service #355

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

xiaoxichen
Copy link
Collaborator

@xiaoxichen xiaoxichen commented Mar 19, 2024

This is the change we need for production , for more background we recorded here eBay/HomeObject#110

Consumer setting the device type to auto will let HS choose based on what it has.

@xiaoxichen xiaoxichen requested review from yamingk and hkadayam March 19, 2024 01:12
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 61.36364% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 58.00%. Comparing base (45c637e) to head (dae1eb2).
Report is 1 commits behind head on master.

Files Patch % Lines
src/lib/homestore.cpp 51.51% 12 Missing and 4 partials ⚠️
src/lib/blkdata_svc/blkdata_service.cpp 50.00% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
- Coverage   61.01%   58.00%   -3.02%     
==========================================
  Files         136      108      -28     
  Lines       14598     9515    -5083     
  Branches     1756     1230     -526     
==========================================
- Hits         8907     5519    -3388     
+ Misses       4958     3459    -1499     
+ Partials      733      537     -196     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xiaoxichen xiaoxichen force-pushed the dev_by_type branch 3 times, most recently from 0470247 to a7c3a97 Compare March 26, 2024 17:36
Setting to auto will decide based on whether we have
FAST and the service characteristic.

Also chaning pct_to_size to take the size of that type.

Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
@@ -365,7 +425,7 @@ shared< VirtualDev > HomeStore::create_vdev_cb(const vdev_info& vinfo, bool load
}

uint64_t HomeStore::pct_to_size(float pct, HSDevType dev_type) const {
uint64_t sz = uint64_cast((pct * static_cast< double >(m_dev_mgr->total_capacity())) / 100);
uint64_t sz = uint64_cast((pct * static_cast< double >(m_dev_mgr->total_capacity(dev_type))) / 100);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the most significant behavior change in the case of hybrid storage.

Previously we calculate the size based on PCT * (HDD+SSD) , now it is PCT * size_of_target_device_type

conanfile.py Outdated
@@ -5,7 +5,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.0.1"
version = "6.1.1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically a major (non-backwards compat) change. So if not going to bump Major, patch is good enough?

@@ -87,7 +87,7 @@ constexpr uint16_t MAX_UUID_LEN{128};
static constexpr hs_uuid_t INVALID_SYSTEM_UUID{0};

///////////// All Enums //////////////////////////
ENUM(HSDevType, uint8_t, Data, Fast);
ENUM(HSDevType, uint8_t, Auto, Data, Fast);
Copy link
Contributor

@yamingk yamingk Apr 3, 2024

Choose a reason for hiding this comment

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

I guess I am not clear on how HomeObj will specify the percentage for each service with this Auto devType in place.
How can HomeObj know whether it is mixed dev type, so that META+LOG+INDEX can accumulate upto 100% of the SSD drive, and the replication could consume 100% of the other devType drives, and if it is not mixed, say all HDD, or all NVMe, then META+LOG+INDEX+REPLICATION should accumulate upto 100%.

Can you share how is HomeObject going to use this?

// applying optimal placement for auto
for (auto& [svc_type, fparams] : format_opts) {
if ((svc_type & HS_SERVICE::META) && has_meta_service()) {
if (fparams.dev_type == HSDevType::Auto) { fparams.dev_type = get_optimal_dev_type(svc_type); }
Copy link
Contributor

@yamingk yamingk Apr 3, 2024

Choose a reason for hiding this comment

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

To simplify the logic a bit, I am thinking can we relax this Auto check, and call get_optimal_dev_type directly for every services, the logic is consumer can specify FAST, but if fast is not available, we fall back to DATA.

This is the logic we apply for 1.3 HomeStore also. Does it make sense?
This doesn't resolve the percentage thing (mentioned eBay/HomeObject#110) for mixed/non-mixed drives type, though (which I am not clear with this PR -- my above comment).

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
@yamingk
Copy link
Contributor

yamingk commented Apr 4, 2024

LGTM, can you also run ./bin/test_raft_repl_dev on your local machine (i don't think this PR will break anything) which currently doesn't run in conan build as well as github CI, just to make sure everything is right.

@xiaoxichen
Copy link
Collaborator Author

Merge as test_raft_repl_dev passsed

[       OK ] RaftReplDevTest.Leader_Restart (28386 ms)
[       OK ] RaftReplDevTest.Leader_Restart (28386 ms)
[       OK ] RaftReplDevTest.Leader_Restart (28386 ms)
[----------] 6 tests from RaftReplDevTest (115097 ms total)

[----------] 6 tests from RaftReplDevTest (115090 ms total)

[----------] 6 tests from RaftReplDevTest (115278 ms total)

[----------] Global test environment tear-down
[----------] Global test environment tear-down
[----------] Global test environment tear-down
[==========] 6 tests from 1 test suite ran. (115097 ms total)
[==========] 6 tests from 1 test suite ran. (115090 ms total)
[==========] 6 tests from 1 test suite ran. (115278 ms total)
[  PASSED  ] 6 tests.
[  PASSED  ] 6 tests.
[  PASSED  ] 6 tests.

@xiaoxichen xiaoxichen merged commit 60808d0 into eBay:master Apr 5, 2024
20 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.

None yet

4 participants