Repository navigation
crimson/os/seastore/btree: link fixedkvbtree's nodes and logical extents with forward and backward pointers, and drop the pin_set - #47749
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
I'm still trying to optimize the code and add unit tests |
3dd65c0 to
7e310c8
Compare
7e310c8 to
d8cbf9e
Compare
|
jenkins retest this please |
c352ccc to
e8b716a
Compare
748fb97 to
2fb83c8
Compare
|
jenkins test make check |
|
jenkins test make check arm64 |
9023237 to
24fea12
Compare
|
jenkins test make check |
athanatos
left a comment
There was a problem hiding this comment.
I'm about halfway through the branch. It would help me to have a short, precise description of how the tracker, btree node, and transaction relate, presumably in btree_child_tracker.h. I'll pick the review back up once that's added.
…n retrieving btree nodes Signed-off-by: Xuehan Xu <[email protected]>
…rought the backref tree After involving intra-fixed-kv-btree parent-child pointers, we need to keep the invariant that it's only when extents are not in transactions' read_set that we can directly query cache with inspecting the transaction Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…inters Signed-off-by: Xuehan Xu <[email protected]>
…h leaf nodes with(out) children Signed-off-by: Xuehan Xu <[email protected]>
…ents by pointers Signed-off-by: Xuehan Xu <[email protected]>
… pointers to read extent Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…rs during unittests Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
TransactionManager::read_pin() Signed-off-by: Xuehan Xu <[email protected]>
db2d13e to
33b56a0
Compare
|
|
jenkins test make check |
|
The build looks good! Let's freeze the change and merge once the make check is good. My local test shows the avg IOPS goes from ~2550 to ~2745: |
|
jenkins test make check |
|
@xxhdx1985126 let me know if there are changes related to the unaddressed comments. |
OK:-) |
|
I am not sure this is the right place to ask a question. Anyway, I recently encountered a seg fault because the osd accesses an invalid extent (already freed) during the rados test while RANDOM_BLOCK_SSD is enabled (./bin/rados bench -p testpool 60 write -t 32 -b 4K --no-cleanup). From my observation, Am I missing something? @xxhdx1985126 @cyx1231st |
This comment was marked as duplicate.
This comment was marked as duplicate.
cyx1231st
left a comment
There was a problem hiding this comment.
I am not sure this is the right place to ask a question.
It is fine to discuss in the related PR. I just started a thread so the related discussions can be chained together.
| //TODO: can this search be avoided? | ||
| auto off = parent->lower_bound_offset(laddr); | ||
| assert(parent->get_key_from_idx(off) == laddr); | ||
| parent->children[off] = this; |
There was a problem hiding this comment.
Note that paddr<Dev(128),5369872384> is ONODE_BLOCK_STAGED and this was mutated before the get_pin().
But, the pin, the result of get_pin(), has a wrong parent pointer (seems that the parent pointer is not updated after a transaction is done).
See
ceph/src/crimson/os/seastore/btree/fixed_kv_node.h
Lines 57 to 70 in 1caadd7
There is an invariant that parent and children must always point to each other symmetricly before and after the commit. Seems your observation reflects this invarient is somehow broken. This should be the related logic to update the pointers between the LBALeaf and the LogicalCachedExtent(e.g. Onode) upon commit. Probably worth digging why the parent and children pointers are broken under the specific scenario.
As a result, get_logical_child() accesses a child, which was invalid by the recent mutation (the prior pointer). I found that there is a condition to check the pointer is invalid, but just accessing it causes a seg fault.
@myoungwon Can you show the entire call stack about where the seg faulted check happens? Does it happen without RBM?
There was a problem hiding this comment.
I'm looking for a way to share the log.
osd0.log: https://drive.google.com/file/d/1E3_wKRPKRLjIPVqSOT7b8due2yJiAYZV/view?usp=sharing
osd0.stdout: https://drive.google.com/file/d/1hpAakO-kimTbCQVxny933QJFbY4YsGcl/view?usp=sharing
Can you see the above logs (please understand the manual logs for debugging I added)? Note that I just added logs, not touching existing code.
There was a problem hiding this comment.
Can you see the above logs (please understand the manual logs for debugging I added)?
Yes, I'm reading it.
There was a problem hiding this comment.
osd0.log: https://drive.google.com/file/d/1E3_wKRPKRLjIPVqSOT7b8due2yJiAYZV/view?usp=sharing
osd0.stdout: https://drive.google.com/file/d/1hpAakO-kimTbCQVxny933QJFbY4YsGcl/view?usp=sharing
@myoungwon What's the branch of the code? Is it main?
There was a problem hiding this comment.
Yes, it is main. I just added a few lines for logging (not related to seastore's operations). You can reproduce this by changing seastore_main_device_type in src/common/options/crimson.yaml.in to RANDOM_BLOCK_SSD. Then, run vstart.sh with rados bench.
There was a problem hiding this comment.
@cyx1231st @myoungwon This issue should be fixed by #51948, please take a look.
The root cause is that I did all lba pointer adjustments of newly created lba nodes in the prepare_write interface which is invoked on ool extents before the transaction goes into the prepapre phase.
This was alright in segmented device scenarios because all lba/backref nodes are inline, which is not true for random block devices.
| assert(child); | ||
| assert(child == cnode.get()); | ||
| assert(cnode->is_parent_valid()); | ||
| } else { |
There was a problem hiding this comment.
EXIST_CLEAN and EXIST_MUTATION_PENDING child_node seem to be falling into this else case, which should be wrong because the else case expects the child_node is stable.
This issue was observed during testing #51179 which depends on the EXIST_CLEAN/PENDING features.
Probably need to scan other places as well to make sure EXIST_CLEAN and EXIST_MUTATION_PENDING extents are correctly handled with the lba tree pointers.
After this optimization, total cpu time spent in FixedKVBtree::lower_bound drops from 23.4% to 15.1%:
Before:


After:
Total cpu time spent doing FixedKVBtree related operations drops from 27.4 % to 20.5%
Before:


After:
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
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 windows