Skip to content

crimson: drop duplicated PluginRegistry and util.cc from crimson archives - #71760

Merged
Matan-B merged 4 commits into
ceph:mainfrom
tchaikov:wip-crimson-dedup-symbols
Oct 22, 2026
Merged

Matan-B merged 4 commits into
ceph:mainfrom
tchaikov:wip-crimson-dedup-symbols

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

with mold, unittest-collection-manager and unittest-object-data-handler fail to link:

mold: error: duplicate symbol: lib/libcrimson-alienstore.a(PluginRegistry.cc.o): lib/libcrimson-common.a(PluginRegistry.cc.o): ceph::PluginRegistry::~PluginRegistry()

so we either replace the unused bits with a stub, or just drop them.

tested with mold: both tests above and unittest-seastar-messenger pass, and crimson-store-nbd, crimson-objectstore-tool and crimson-store-bench link.

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.

Comment thread src/common/ceph_context.h Resolved
@tchaikov
tchaikov force-pushed the wip-crimson-dedup-symbols branch from e098237 to 9c644d3 Compare October 12, 2026 03:53
@tchaikov
tchaikov requested review from Matan-B and ronen-fr October 12, 2026 03:54
@tchaikov

tchaikov commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@Matan-B hi Matan, could you take another look when you have time? I replied to your question about #ifndef WITH_CRIMSON in the thread. In short, after this change nothing in crimson references PluginRegistry, so there's nothing left to guard.
@ronen-fr hi Ronen, I'd appreciate your review too. this changeset removes the last duplicated source, debug_level_guard.cc, and with it the --allow-multiple-definition workaround that e552441 added for crimson-osd. With no strong symbols shared between crimson-alienstore and crimson-common, mold links crimson-osd without the flag.

@ronen-fr

Copy link
Copy Markdown
Contributor

Trying this out.

@tchaikov - note, BTW, #72620, which touches the linking, too.

@ronen-fr

ronen-fr commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

test_rgw_sync_trace.cc would not compile. Let's see if related to this PR.
Not related. The compilation fails in 'main', too.

@tchaikov

Copy link
Copy Markdown
Contributor Author

test_rgw_sync_trace.cc would not compile. Let's see if related to this PR. Not related. The compilation fails in 'main', too.

@ronen-fr hey Ronen, thanks for looking into it. not sure what the FTBFS was, but i am trying to fix one build failure in #72660 . probably you are interested in reviewing it as well?

@ronen-fr

Copy link
Copy Markdown
Contributor

Hi, @tchaikov . LGTM.
One AI nit:
crimson-alienstore now resolves DebugLevelGuard::check from crimson-common but doesn't list it in target_link_libraries. It works today only because crimson-os happens to link crimson after alienstore. With ld.bfd, which depends on link order, another target could get an undefined reference.


std::optional<ceph::bufferlist> TxHandler::compress(const ceph::bufferlist&)
{
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.

Here (and the two below): suggest ceph_abort_msg() with a meaningful message

@ronen-fr ronen-fr 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.

some comments. @Matan-B ?

@Matan-B Matan-B added this to Crimson Oct 14, 2026
@Matan-B Matan-B moved this to Needs QA in Crimson Oct 14, 2026
@tchaikov

Copy link
Copy Markdown
Contributor Author

Hi, @tchaikov . LGTM. One AI nit: crimson-alienstore now resolves DebugLevelGuard::check from crimson-common but doesn't list it in target_link_libraries. It works today only because crimson-os happens to link crimson after alienstore. With ld.bfd, which depends on link order, another target could get an undefined reference.

@ronen-fr hi Ronen, addressed both in the latest revision.

unittest-collection-manager and unittest-object-data-handler fail to
link with mold:

  mold: error: duplicate symbol: lib/libcrimson-alienstore.a(PluginRegistry.cc.o): lib/libcrimson-common.a(PluginRegistry.cc.o): ceph::PluginRegistry::~PluginRegistry()

PluginRegistry.cc is compiled into both archives, once with WITH_CRIMSON
and once without, so they define two different classes under the same
name, an ODR violation. crimson only has its copy because frames_v2.cc
calls the on-wire compression handlers, which pull in Compressor and the
plugin registry. But crimson never advertises msgr2 compression, so it
never creates a handler.

Replace compression_onwire.cc with a stub of the three handler methods
frames_v2.cc calls, which abort if reached. Compressor.cc,
PluginRegistry.cc and the unused get_plugin_registry() can then go from
crimson. Loading compressor plugins in crimson would need them built
against crimson's CephContext, which can wait until crimson needs
compression.

Signed-off-by: Kefu Chai <[email protected]>
Both crimson-alienstore and crimson-common compile common/util.cc, but
no alien code calls anything in it. Only crimson-common's copy is used,
by OSD::_send_boot(). Nothing pulls the alien copy into a binary yet,
but once something does, mold will reject the duplicates.

Signed-off-by: Kefu Chai <[email protected]>
Since 6dd4b1e, both crimson-common and crimson-alienstore define
DebugLevelGuard::check(). Nothing in it depends on WITH_CRIMSON, so the
two copies are identical. Let the alien store use the one in
crimson-common, as it already does for ceph::buffer and friends.

crimson-alienstore does not list crimson-common in its link libraries,
and links only because its users put crimson after it. Add it as a
link-only interface dependency, so CMake orders it for every user. A
regular dependency would also pass crimson-common's WITH_CRIMSON to the
alien sources, which must be built without it.

Signed-off-by: Kefu Chai <[email protected]>
e552441 added this flag so crimson-osd could link with mold despite
the symbols both crimson-alienstore and crimson-common define. They no
longer share any, and the flag would only hide the next duplicate, so
drop it along with the comments describing the workaround.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-crimson-dedup-symbols branch from 9c644d3 to 1280d1b Compare October 14, 2026 08:39
@perezjosibm

perezjosibm commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
PR=wip-perezjos-crimson-only-15-10-2026-PR71760
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR -f debug --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-10-19 09:02:34,619.619 INFO:teuthology.suite.run:Test results viewable at 

https://pulpito-ng.ceph.com/jjperez-2026-10-19_08:56:15-crimson-rados-wip-perezjos-crimson-only-15-10-2026-PR71760-distro-debug-trial/

  • QA analysis complete: a new SIGSEGV emerged and raised provisional tracker, @tchaikov would you please mind have a look to see whether is related to the changes in this PR? Many thanks in advance

Jobs Tracker
657442 Bug #81919: SIGSEGV during ShardServices::send_with_throttling()

@perezjosibm perezjosibm moved this from Needs QA to QA in Progress in Crimson Oct 15, 2026
@perezjosibm perezjosibm moved this from QA in Progress to Tested in Crimson Oct 20, 2026
@tchaikov

tchaikov commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author
* QA [analysis](https://tracker.ceph.com/projects/crimson/wiki/MAIN#httpspulpitocephcomjjperez-2026-10-19_085615-crimson-rados-wip-perezjos-crimson-only-15-10-2026-PR71760-distro-debug-trial) complete: a new SIGSEGV emerged and raised provisional tracker, @tchaikov would you please mind have a look to see whether is related to the changes in this PR? Many thanks in advance

Jobs Tracker 657442 Bug #81919: SIGSEGV during ShardServices::send_with_throttling()

@perezjosibm hi Jose, thank you for testing this change. and sure! just took a look. the segfault was not caused by my change. created a fix for it. see #72962

@tchaikov

Copy link
Copy Markdown
Contributor Author

@perezjosibm hey Jose, is this change good to merge or we'd prefer testing it again, along with #72962 after the latter is approved?

@Matan-B

Matan-B commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for looking into the (unreleated) failure and fixing it. Merging

@Matan-B
Matan-B merged commit b69b5e5 into ceph:main Oct 22, 2026
15 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Oct 22, 2026
@tchaikov
tchaikov deleted the wip-crimson-dedup-symbols branch October 22, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

4 participants