Skip to content

Read API impl#89

Merged
raakella1 merged 8 commits intoeBay:mainfrom
raakella1:read_impl
May 22, 2025
Merged

Read API impl#89
raakella1 merged 8 commits intoeBay:mainfrom
raakella1:read_impl

Conversation

@raakella1
Copy link
Contributor

No description provided.

@raakella1 raakella1 force-pushed the read_impl branch 5 times, most recently from 96c7fc7 to 5d979e7 Compare May 16, 2025 22:12
@codecov-commenter
Copy link

codecov-commenter commented May 16, 2025

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

Codecov Report

Attention: Patch coverage is 85.41667% with 21 lines in your changes missing coverage. Please review.

Project coverage is 80.98%. Comparing base (0b40663) to head (270aafb).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/volume_mgr.cpp 78.12% 11 Missing and 3 partials ⚠️
src/lib/volume/tests/test_volume_io.cpp 93.93% 2 Missing and 2 partials ⚠️
src/lib/index.cpp 66.66% 2 Missing and 1 partial ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #89       +/-   ##
===========================================
+ Coverage   61.68%   80.98%   +19.29%     
===========================================
  Files          15       17        +2     
  Lines         462      999      +537     
  Branches       35      105       +70     
===========================================
+ Hits          285      809      +524     
+ Misses        158      140       -18     
- Partials       19       50       +31     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raakella1 raakella1 force-pushed the read_impl branch 2 times, most recently from 79c9071 to b9be84e Compare May 20, 2025 01:22
blks_to_read.emplace_back(index_kvs[start_idx].first.key(), homestore::MultiBlkId(blk_num, blk_count, chunk_num));
start_idx = i;
if(!is_contiguous) {
// this is the last entry in the index_kvs
Copy link
Collaborator

@yamingk yamingk May 21, 2025

Choose a reason for hiding this comment

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

is this correct? if is_contigous is false, it will also come here, it can be any non-1st (i != 0) entry in index_kvs, right? We have to go to next loop to keep accumulating the conginous ones.

continue;
}
}
// prepare the blkid for the read
Copy link
Collaborator

@yamingk yamingk May 21, 2025

Choose a reason for hiding this comment

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

I would suggest to:

if(is_contiguous && i < index_kvs.size() - 1) {
    continue;
}

if (!is_contigous) {
 // build build id and put back to result
} else {
  assert ( i == index_kvs.size() -1);
  // last blk id, push back to result
  // fall through to let for loop to exit;
}

TEST_F(VolumeIOTest, SingleVolumeReadData) {
// Write and verify fixed LBA range to single volume multiple times.
auto vol = volume_list().back();
uint32_t nblks = 5000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some io's which have hole and your read covers those ranges with holes and ranges with data this PR or another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will have a separate PR just for adding more test cases

sisl::sg_list data_sgs;
data_sgs.iovs.emplace_back(iovec{.iov_base = vol_req->buffer, .iov_len = data_size});
data_sgs.size = data_size;
void HomeBlocksImpl::generate_blkids_to_read(const index_kv_list_t& index_kvs, read_blks_list_t& blks_to_read) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please write a unit test case for this API alone. We can fake input of index_kvs, and assert on output blks_to_read.
You can do it on next PR.

Unit test coverage can be:

  1. all contigous.
  2. all dis-contigous.
  3. a bunch of mixed ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will have a separate PR to cover different cases for the holes

@raakella1 raakella1 merged commit 9843dda into eBay:main May 22, 2025
19 checks passed
@raakella1 raakella1 deleted the read_impl branch May 22, 2025 16:37
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