Skip to content

osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssig - #67253

Merged
rzarzynski merged 1 commit into
ceph:mainfrom
VinayakTiwari1103:osd-fix-build-incremental-map-msg-abort
Apr 13, 2026
Merged

rzarzynski merged 1 commit into
ceph:mainfrom
VinayakTiwari1103:osd-fix-build-incremental-map-msg-abort

Conversation

@VinayakTiwari1103

@VinayakTiwari1103 VinayakTiwari1103 commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

osd: avoid ceph_abort in build_incremental_map_msg when newest_map is missing

When sharing OSD maps with a peer (e.g. during heartbeat in maybe_share_map), we may have already trimmed the requested range or newest_map (e.g. trim race, or store read failure). In that case the panic path tried to send newest_map; if it could not be loaded, the code called ceph_abort() and crashed the OSD.

Log and return an empty MOSDMap instead of aborting. The receiver drops such messages (last <= superblock.get_newest_map()) and can re-request from the mon.

Fixes: https://tracker.ceph.com/issues/74800

Signed-off-by: Vinayak Tiwari <[email protected]>

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@VinayakTiwari1103
VinayakTiwari1103 requested a review from a team as a code owner February 8, 2026 08:27
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

13 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@github-actions github-actions Bot added the core label Feb 8, 2026

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add the Fixes and Signed-off-by lines to the commit's description?
Also, having (in the commit description) the explanation on when an OSD might not have the map would be needed.

@rzarzynski

Copy link
Copy Markdown
Contributor

CC: @VinayakTiwari1103.

@VinayakTiwari1103

Copy link
Copy Markdown
Contributor Author

CC: @VinayakTiwari1103.

Done @rzarzynski ,I have updated it ,Sorry for the Late reply

@kamoltat

Copy link
Copy Markdown
Member

Hi @VinayakTiwari1103
You Please also Fixes and Signed-off-by in the Commit itself as well

@VinayakTiwari1103 VinayakTiwari1103 changed the title osd: avoid ceph_abort in build_incremental_map_msg when newest_map is… osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssign Feb 23, 2026
@VinayakTiwari1103 VinayakTiwari1103 changed the title osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssign osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssig Fixes: https://tracker.ceph.com/issues/74800 Signed-off-by: Vinayak Tiwari <[email protected]> Feb 23, 2026
@VinayakTiwari1103 VinayakTiwari1103 changed the title osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssig Fixes: https://tracker.ceph.com/issues/74800 Signed-off-by: Vinayak Tiwari <[email protected]> osd: avoid ceph_abort in build_incremental_map_msg when newest_map is misssig Feb 23, 2026
@VinayakTiwari1103
VinayakTiwari1103 force-pushed the osd-fix-build-incremental-map-msg-abort branch from ca58652 to 4edabc6 Compare February 23, 2026 20:42
@VinayakTiwari1103

Copy link
Copy Markdown
Contributor Author

Hi @VinayakTiwari1103 You Please also Fixes and Signed-off-by in the Commit itself as well

Got it now

@kamoltat kamoltat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bake this change in main for awhile.

Comment thread src/osd/OSD.cc
if (!get_map_bl(m->newest_map, bl)) {
derr << __func__ << " unable to load latest full map " << m->newest_map
<< dendl;
ceph_abort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we shouldn't ceph_abort() here as OSDSuperblock can get changed (and thus m->newest_map can be stale) while a thread is within OSDService::build_incremental_map_msg().

Comment thread src/osd/OSD.cc
m->maps[m->newest_map] = std::move(bl);
} else {
derr << __func__ << " unable to load latest map " << m->newest_map
<< ", sending empty map message (peer will drop or re-request from mon)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree m is empty at the moment. If an execution reaches this code, m contains no map nor incremental map. The reason in the early exit above:

  if (!m->maps.empty() ||
      !m->incremental_maps.empty()) {
    // send what we have so far
    return m;
  }

OK.

@shraddhaag

Copy link
Copy Markdown
Contributor

RADOS Approved: https://tracker.ceph.com/projects/rados/wiki/MAIN#httpstrackercephcomissues75305

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run.

@ljflores

Copy link
Copy Markdown
Member

jenkins test docs

@ljflores

Copy link
Copy Markdown
Member

This can be merged once the docs check passes.

@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test docs

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

… missing

When sharing OSD maps with a peer (e.g. during heartbeat in
maybe_share_map), we may have already trimmed the requested range or
newest_map (e.g. trim race, or store read failure). In that case the
panic path tried to send newest_map; if it could not be loaded, the
code called ceph_abort() and crashed the OSD.

Log and return an empty MOSDMap instead of aborting. The receiver drops
such messages (last <= superblock.get_newest_map()) and can re-request
from the mon.

Fixes: https://tracker.ceph.com/issues/74800
Signed-off-by: Vinayak Tiwari <[email protected]>
@ljflores
ljflores force-pushed the osd-fix-build-incremental-map-msg-abort branch from 4edabc6 to c08a0eb Compare April 10, 2026 18:33
@ljflores

Copy link
Copy Markdown
Member

@VinayakTiwari1103 I rebased your branch to hopefully get the docs check to pass.

@VinayakTiwari1103

Copy link
Copy Markdown
Contributor Author

@VinayakTiwari1103 I rebased your branch to hopefully get the docs check to pass.

Thanks @ljflores for rebasing the branch and helping with the docs check!

Apologies for the delayed response. Please let me know if any further changes are needed from my side.

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

@VinayakTiwari1103 - Approvals are pending for this PR. Once the required approvals are received, please feel free to proceed with the merge.

@rzarzynski
rzarzynski merged commit 7248b9c into ceph:main Apr 13, 2026
6 checks passed
batrick added a commit to batrick/ceph that referenced this pull request Apr 14, 2026
* refs/pull/66294/head:
	qa: enforce centos9 for test
	qa: rename distro
	qa/suites/fs/bugs: use centos9 for squid upgrade test
	qa: remove unused variables
	qa: use centos9 for fs suites using k-testing
	qa: update fs suite to rocky10
	qa: skip dashboard install due to dependency noise
	qa: only setup nat rules during bridge creation
	qa: correct wording of comment
	qa: use nft instead iptables
	qa: use py3 builtin ipaddress module
	Merge pull request ceph#68167 from smanjara/wip-fix-75465
	Merge pull request ceph#67253 from VinayakTiwari1103/osd-fix-build-incremental-map-msg-abort
	osd: avoid ceph_abort in build_incremental_map_msg when newest_map is missing
	qa/multisite: fix test_bucket_remove false failure on bucket deletion check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants