Conversation
aclamk
left a comment
There was a problem hiding this comment.
Good fix.
We should schedule iterator invalidation review one day.
| range_tree.emplace_hint(rs, seg_after.start, seg_after.end); | ||
| range_size_tree.emplace(seg_after); | ||
| // shink the left seg in offset tree | ||
| rs->second = start; |
There was a problem hiding this comment.
I think we should create a comment, something like:
// btree_map.emplace_hint invalidates rs.
otherwise there is a cryptic code move.
There was a problem hiding this comment.
I just tested that the same happens with btree_map.emplace() = iterator is invalidated.
Maybe we should review the code again, to check for it?
There was a problem hiding this comment.
I think we should create a comment, something like:
// btree_map.emplace_hint invalidates rs.otherwise there is a cryptic code move.
done
There was a problem hiding this comment.
I just tested that the same happens with
btree_map.emplace()= iterator is invalidated. Maybe we should review the code again, to check for it?
I did a brief check - looks like we mostly safe, the only suspicious location is _try_remove_from_tree() function but it's not used for now since it's intended for HybridAllocator wrapping.
3447e4a to
1978bfd
Compare
Fixes: https://tracker.ceph.com/issues/61949 Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
1978bfd to
c4c3e34
Compare
tchaikov
left a comment
There was a problem hiding this comment.
thank you for fixing this issue! didn't get a chance to look into it.
| range_size_tree.emplace(seg_after); | ||
| // shink the left seg in offset tree | ||
| // this should be done before calling any emplace/emplace_hint | ||
| // on range_tree since they invalidate rs iterator. |
There was a problem hiding this comment.
ahh, thank you for fixing this!
retriggering. |
|
jenkins test make check |
3 similar comments
|
jenkins test make check |
|
jenkins test make check |
|
jenkins test make check |
Fixes: https://tracker.ceph.com/issues/61949
Signed-off-by: Igor Fedotov igor.fedotov@croit.io
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