Repository navigation
osd: Fix use of undefined end() iterator in proc_master_log - #71595
JonBailey1993 wants to merge 1 commit into
Conversation
f45c42b to
43a6d6b
Compare
|
Thanks very much. I have now created a tracker ticket here: https://tracker.ceph.com/issues/80359 |
|
@JonBailey1993 thanks for create the tracker ticket . could you associate this fix with it? namely, to add a "Fixes: https://tracker.ceph.com/issues/80359" tag in the commit message. |
In proc_master_log, we need to decide when to call consider_adjusting_pwlc(...). We do this by comparing the incoming log from a message against our own log. We use an iterator pointing at the end of the incoming log and compare it to our own log in various ways to determine if we need to adjust the pwlc values. For all non-empty cases, we were comparing olog.log.end()->version with p->version, where accessing olog.log.end() results in undefined behaviour (https://en.cppreference.com/cpp/container/list/end). This fixes the issue by decrementing the iterator for these cases so we are pointing at the final element of the log instead of the end() iterator which is one past the end. Fixes: https://tracker.ceph.com/issues/80359 Signed-off-by: Jon Bailey <[email protected]> Assisted-by: IBM Bob 2.2.0
43a6d6b to
40d4890
Compare
|
@tchaikov I've added a trailer to the commit and modified the PR description so both use the format you describe. |
|
jenkins test windows |
|
jenkins test windows |
|
This PR has been added to wip-bharath10-testing-20260910.230227-main. |
|
The fix in this PR is very similar to the fix in #70149. I've also got a commit that extends the peering state test harness to unit test the 3 modified code paths. |
|
As mentioned previously, the changes on this commit are similar to those on #70149. It is somewhat reassuring that two independent bits of debugging have arrived at essentially the same fix, however there is an additional fix included in 70149 that is missing from this PR that correctly handles pwlc when there are gaps in the log (for example caused by a PG split). I suggest closing this PR as a duplicate of 70149 |
|
Closing in favour of 70149 so that the extra fix added in that PR will be merged as suggested by @bill-scales |
osd: Fix use of undefined end() iterator in proc_master_log
In proc_master_log, we need to decide when to call consider_adjusting_pwlc(...). We do this by comparing the incoming log from a message against our own log. We use an iterator pointing at the end of the incoming log and compare it to our own log in various ways to determine if we need to adjust the pwlc values. For all non-empty cases, we were comparing olog.log.end()->version with p->version, where accessing olog.log.end() results in undefined behaviour (https://en.cppreference.com/cpp/container/list/end).
This fixes the issue by decrementing the iterator for these cases so we are pointing at the final element of the log instead of the end() iterator which is one past the end.
Fixes: https://tracker.ceph.com/issues/80359
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 test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.