Repository navigation
crimson/os/seastore: add back-reference - #45390
Conversation
|
I'm still debugging this pr |
|
the first 3 commits come from pr #44912 |
6532749 to
53f4438
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
53f4438 to
a71e86e
Compare
6bc0124 to
57f95fe
Compare
57f95fe to
3b0d0f9
Compare
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
3b0d0f9 to
02cfc00
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
02cfc00 to
9c9d8df
Compare
Signed-off-by: Xuehan Xu <[email protected]>
…e_visitor_t Signed-off-by: Xuehan Xu <[email protected]>
… Cache::backref_extents Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…ith the help of backref Signed-off-by: Xuehan Xu <[email protected]>
…e leaf nodes Signed-off-by: Xuehan Xu <[email protected]>
…ger/backref_manager's complete_transaction Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…loc infos in segment header/tail Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…sk without initializing For the purpose of higher space reclaim perf, we load backref extents by parallelly invoking Cache::get_extent_by_type, which means loaded backref extents won't be initialized Signed-off-by: Xuehan Xu <[email protected]>
This should reduce the conflicts between gc transactions and io transactions Signed-off-by: Xuehan Xu <[email protected]>
Yes, I just wanted to confirm that your test's result is consistent with mine. I think I can explain why we see more invalid writes and conflicts between gc transactions and io transactions: extents rewriting now operates the backref tree, which will create backref extents which doesn't exist before this pr and will be counted as invalid writes if the transaction gets invalidated, so we see more invalid writes. Since extents rewriting needs to operates the backref tree, the time it takes to complete gc transactions becomes longer, the longer it takes, the more possible gc transactions get invalidated. This pr is partly aiming at improving performance of space reclamation by avoiding the need to scan disks for reclaiming the corresponding disk space, the effect is shown in https://gist.github.com/xxhdx1985126/8e038946ad53bb3c021cbfaf5e7fa022. As to the conflicts and invalid writes issue, I think we can avoid it completely by eliminating the possibility of conflicts between gc transactions and io transactions, which is exactly what I'm working on right now. |
|
From my understanding from #46158 (comment), I agree with @xxhdx1985126 's point that the existing reclaiming logic is not efficient, and the backref tree is helpful in this case:
|
|
@cyx1231st I'm ok with merging this once you're happy with it. |
|
Generally look good to me, except the concern from thread #45390 (comment).
@xxhdx1985126 I'm curious about how to eliminate these conflicts, would you mind elaborating more about it? |
@cyx1231st Sorry that I missed your comment the other day. About elimiting the conflicts, what I really meant was that, I planned to modify the current transaction conflicts handling mechanism, so that, instead of rolling back other transactions, we make conflicting transactions agree on the final outcome, and the repeat overhead can be avoided. But, this turns out to be complicated, I'm trying to see if it's worth it, right now. Or maybe there are other solutions, like what sam suggested in: https://gist.github.com/xxhdx1985126/1c49d0de2a8590aed5d62e611cbc63cd I'm really sorry for replying so late. |
|
@xxhdx1985126 no worry at all.
Yeah, I agree that this is complicated. For example, how to coordinate multiple conflicting transactions that are trying to split the same set of tree nodes but in different ways. |
|
A quick sketch of what this might look like for onode or lba tree nodes is:
The above would impose a lot of overhead and is actually more similar to what we already do than it appears. A straightforward way to reduce the overhead would be to version groups of keys rather than individual keys with larger groups corresponding to smaller memory/runtime overhead. There's a continuum of conflict detection vs memory tradeoffs: individual key vs groups of keys within an extent vs single whole extent group (what we do now). We can test the whether the above is worth bothering with by artificially restricting the size of lba/onode btree nodes as that would have the same effect of reducing the key conflict group size. |
Yeah, I'm working on that. |
|
If the major issue is only between MUTATE and CLEANER_RECLAIM transactions, another possible way might be to decrease This might be simpler than adding version number to the keys, as the key layout of ONODE tree is already very complicated. |
I think those parallel cleaner_reclaim transactions can conflict with each other on the lba/backref tree, am I right? The backref tree is indexed by paddr, so those transactions can have a relative high probability of colliding on the same backref extent. Altough, for the backref part, maybe we can separate the backref tree updates from cleaner_reclaim transactions into dedicated transactions, which is what I'm trying to see the feasibility of now(related to the drawback I mentioned here), there's still conflicts on the lba tree, with which we have to deal, right?
Actually, for the logical extents, I had another idea: Since rewriting logical extents doesn't cause any change to the logical extents itself at all. So I think maybe we optimize gc perf by making the space reclamation and journal trimming transaction do the extent content copy after they enter the "prepare" phase. With this approach, client io transactions can only contradict the gc transactions on logical extents in the following two scenarios:
(BTW, this may be actually more complicated than it seems, as sam suggested) But on the other hand, according to the test result here, cleaner_trim transactions conflicts with io transactions mostly on lba nodes and seldom on logical extents, maybe we can skip the onode tree modification for dealing with the issue of space reclamation transactions' conflicts for now. Am I right? I think your pr #46310 has reduced conflicts on onode extents of trim transactions very well, and we can wait until the space reclamation conflicts are solved to see whether we need to work further on the onode tree. What do you think? |
|
Yeah, agree with you that onode conflict seems not a major issue right now. |



Back-reference generally works as follows:
Several notes:
E's previous segment is reclaimed and reopened for write, an backref extentBis placed in the exact position where extentEis previously placed, which means theB's paddr would be the same asEin the backref tree if the retiring ofEhas not yet taken place in the backref tree.Signed-off-by: Xuehan Xu [email protected]
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