Repository navigation
Conversation
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
As discussed, IIRC the specific issue was that reclaiming segments are including segments which still have pending writes. So it might be simper to exclude those segments until writes are really committed. |
Sorry, I forgot to provide feedback on this design. It's tricky to manage all concurrent transactions writing to a specific segment, so that the segment state can only be set to "committed"(could be reclaimed by gc process) after all transactions have finished(at the end of Is there anything I missed? |
Probably possible to be handled at more general
I think the information is sufficient above to set a segment state from |
Probably not enough, at this point, the gc transaction can't retrieve the backref changes about this write. |
|
Here is a simplified model:
0713e29 propagates the remapped backref changes to cache in 711a05c checks the to be reclaimed range in |
|
Yeah, it should be handled atomically with |
|
For the graph, IIUC writing the record will be started after "prepare record". |
Oh, it should be "OOL write". Seems journal segment doesn't have similar issue. |
|
I'm not sure if there is a more elegant way to handle the gc trans started at point 2, the solution of manually invalidate transaction in this PR looks ugly. |
Refering to #59367, I think it means OOL writes will be allowed be completed after "prepare record" (OOL writes will still be started before "prepare record"), before "record write", and before "complete commit". So without #59775 (comment), the same problem will still be possible, right? |
… Cache during prepare_record Signed-off-by: Zhang Song <[email protected]>
5f940b4 to
33b8fa0
Compare
cyx1231st
left a comment
There was a problem hiding this comment.
Sorry about the delay. It's reasonable to me to adjust when backref_entry_mset should be updated.
| // entries to ensure the gc transaction could retrieve the latest | ||
| // changes. These entries are merged into backref_entryrefs_by_seq | ||
| // in Cache::complete_commit | ||
| backref_entryrefs_by_trans_id_t backref_entryrefs_by_trans_id; |
There was a problem hiding this comment.
Can it be moved into Transaction?
So there is no need to maintain a separate map.
| if (iter != backref_entryrefs_by_trans_id.end()) { | ||
| auto &cached_refs = iter->second; | ||
| for (backref_entry_ref &e : cached_refs) { | ||
| e->seq = seq; |
There was a problem hiding this comment.
Where is backref_entry_t::seq being used? The information is already in backref_entryrefs_by_seq.
If no user, probably dropping it is simpler?
| i->cast<LogicalCachedExtent>()->get_laddr(), | ||
| i->get_length(), | ||
| i->get_type(), | ||
| start_seq)); |
There was a problem hiding this comment.
Is it reasonable to stick backref_list to where the extent is added/removed during committing a transaction?
See where add_extent() and commit_retire_extent() are called.
Seems to me they are correlated about when an extent should be visible or not.
| extent->get_type()); | ||
| } | ||
|
|
||
| // propagate remapped changes |
There was a problem hiding this comment.
This is about retiring, not only about the remapped changes.
So the method name prepare_remapped_backref_entryrefs() and related comments to claim that it is only for remapping doesn't look correct to me.
| L_ADDR_NULL, | ||
| extent->get_length(), | ||
| extent->get_type(), | ||
| JOURNAL_SEQ_NULL)); // will update in complete_commit |
There was a problem hiding this comment.
Let's take the chance to introduce helper methods create_alloc/retire_backref_mapped_entry(extent).
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
I'll work with @zhscn to address the reviews. |

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