os/bluestore: write_v2 resharding misplaced#61990
Conversation
|
jenkins test make check |
|
@aclamk the functions calling sequence is not changed, before it calls wr.do_write, then dirty_range, then maybe_reshard, 61762 just move dirty_range and maybe_reshard at the end of wr.do_write in order to use aligned offset, the only difference is using aligned offset and length. so, address alignment cause something wrong? I have verified, same place (in do_write_v2 call dirty_range and maybe_reshard) but use original offset and length, then it works. and only dirty_range need original offset and length, maybe_reshard can use aligned location and data_end. I don't know why dirty_range cause this test case crush by aligned address. got it, location and data_end adjsuted are smaller than original offset~length, should add try_reuse_allocated part. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
4d6ddd8 to
04d4baa
Compare
04d4baa to
0a49a7c
Compare
0a49a7c to
69e7c15
Compare
src/os/bluestore/BlueStore.cc
Outdated
| o->extent_map.dirty_range(offset, length); | ||
| o->extent_map.maybe_reshard(offset, offset + length); | ||
| o->extent_map.dirty_range(wr.left_shard_bound, wr.right_shard_bound - wr.left_shard_bound); | ||
| o->extent_map.maybe_reshard(wr.left_shard_bound, wr.right_shard_bound); |
There was a problem hiding this comment.
move this fix to second commit.
|
can we rearrange the commits into 3? the first one: fault_range_ex include determine the left/right bound and dirty_range reshard input parameters modification, also the place moved from Writer.cc to Bluestore.cc. The second one : remove extentmap compress, include the extent merge calculation, the third one: calculate the left/right affect bound and modify dirty_range and reshard input parameters. |
69e7c15 to
966e700
Compare
| emap.insert(*le); | ||
| } | ||
| bstore->logger->inc(l_bluestore_write_small); | ||
| bstore->logger->inc(l_bluestore_write_small_bytes, ref_end - logical_offset); |
There was a problem hiding this comment.
when we check left, we also need check right, for example, there is an extent [4K, 60K], when we write[9K,2K], punch_hole will make extent looks like [4K, 4K] [12K, 52K], we will inset [8K, 4K], we only combined with left make it [4K, 8K], but right one is [12K,52K], we don't combine with right extent. I think we can reuse extent_map.compress_extent_map by left_affect_range and right_affect_range that logic is completely and make code easily readable.
Add fault_range_ex, a sibling to fault_range. The new function does exactly the same as the original. The difference is the returned range <start, end> that reflects range encompassed by shards affected. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
4305224 to
34574a4
Compare
Remove need to call compress_extents. The only place that could produce compressable extents are _try_reuse_allocated_[l/r] functions. Create _place_extent_in_blob() function that adds mapping to blob. If possible, it expands the extent; if not, creates the new one. The function is used whenever we need new mapping to an existing Blob. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com> Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
This reduces size for dirty_range and need_reshard range. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
There was possible case that affected rightmost changed extent. It could be that 2 mergeable extents were next to each other. This change melds them together. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
It could happen that target blob already had empty mapping at the end. In such case, do not add more empty mappings, just expand exising one. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
34574a4 to
71e094f
Compare
|
Passed QA at https://tracker.ceph.com/issues/70440 . |


We should mark dirty and signal for reshard region before we trim the data by _try_reuse_allocated.
Punching hole and writing to already existing blobs is still modification.
The problem was detected using:
./bin/ceph_test_objectstore --log-to-stderr=false --bluestore_write_v2=true --plugin_dir=./lib --gtest_filter=\*SyntheticMatrixShardingLimited\*Problem was introduced in #61762
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e