Conversation
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
|
Need/going to validate it in sepia. |
|
Doesn't see the issue in the tests.
|
src/crimson/osd/pg_map.cc
Outdated
| DEBUG("calling primary to add mapping for pg {} to the expected core {}", | ||
| pgid, core_expected); | ||
| return container().invoke_on( | ||
| 0, [pgid, _core_expected=core_expected, FNAME](auto &primary_mapping) { |
There was a problem hiding this comment.
[pgid, core_expected, ...] should just work?
There was a problem hiding this comment.
I wanted to update core_expected but this lambda doesn't worth to become mutable.
Refer to the following logic:
auto core_expected = _core_expected;
...
core_expected = core_found;
...
assert(core_expected != NULL_CORE);Probably I can rename to make this cleaner.
There was a problem hiding this comment.
Preserved core_expected and renamed to use core_to_update to store the updates.
|
jenkins test windows |
|
@cyx1231st it is also create pg on shard 0 and broadcast to others, why you name the commit : allow multiple shards to create new pg mappings at the same time |
Matan-B
left a comment
There was a problem hiding this comment.
nit, commit message typo: s/eracing/erasing/
Can you please separate the actual fix from the additional asserts/logs added? If not, perhaps a comment which emphasizes where the actual concurrent new mapping occur.
| auto [insert_iter, inserted] = | ||
| primary_mapping.pg_to_core.emplace(pgid, core_expected); | ||
| assert(inserted); |
There was a problem hiding this comment.
The fix here is to emplace the new mapping only if it wasn't already mapped, right? (under find_iter == primary_mapping.pg_to_core.end())
There was a problem hiding this comment.
@cyx1231st it is also create pg on shard 0 and broadcast to others, why you name the commit : allow multiple shards to create new pg mappings at the same time
There was a problem hiding this comment.
Right, because primary_mapping.core_to_num_pgs also needs to keep correct.
| 0, [pgid, _core_expected=core_expected, FNAME](auto &primary_mapping) { | ||
| auto core_expected = _core_expected; | ||
| auto find_iter = primary_mapping.pg_to_core.find(pgid); | ||
| if (find_iter != primary_mapping.pg_to_core.end()) { |
There was a problem hiding this comment.
// this pgid was already mapped within primary_mapping, assert that the
// mapping is consistent and avoid emplacing once again.
if (find_iter != primary_mapping.pg_to_core.end()) {
This fix allows concurrent and consistent updates, meaning that it needs to prevent/assert the inconcistent updates at the same time. So I don't feel that they are splitable. I'll add more comments. |
This PR is allowing multiple shards to create new and consistent pg mappings at the same time, and the design needs these creation to be aligned in shard 0. |
a43f07d to
895c7b9
Compare
|
Changeset: minor renames and added some comments. I'll proceed to merge if no further concerns. |
… the same time Also: * Better detections in case of inconsistent racings, such as: * The new mapping is creating towards different cores. * Mapping creation is racing with its eracing. * Multiple shards are erasing the same mapping at the same time. * Add more logs to debug in case of unexpected issues. Fixes: https://tracker.ceph.com/issues/64934 Fixes: https://tracker.ceph.com/issues/64009 Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
895c7b9 to
2422817
Compare
I suppose there is no impact to the logic already implemented, merging based on the previous test results. |
Can you please attach the failed runs to the tracker next time? This may help with investigating :) |
|
@Matan-B Sure! Thanks for updating the tracker. |
Also:
Fixes: https://tracker.ceph.com/issues/64934
Fixes: https://tracker.ceph.com/issues/64009
Signed-off-by: Yingxin Cheng yingxin.cheng@intel.com
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