Bug #82052
closedbuild: librgw_lancedb.a linked into every RGW binary causes OOM during deb package builds
0%
Description
Since mid-October, the jammy and noble x86_64 deb builds in ceph-dev-pipeline keep failing with make-debs returned non-zero exit status 137. The cause is a host-wide OOM on the 251 GiB builders (soko, adami) during the final link phase. It affects main and unrelated wip branches (e.g. ceph-dev-pipeline 10151, 10157, 10160, 10163, 10178).
What happens¶
src/rgw/CMakeLists.txt links the Rust static library librgw_lancedb.a (lance, arrow, datafusion) into rgw_common as PUBLIC and forces it in with LINKER:--undefined=rgw_sal_wrapper_version. That has two effects:
- Every executable or library that links
rgw_common/rgw_common_standalonecarries the archive. That is about 45 targets in a package build: radosgw, radosgw-admin, rgw-standalone*, librgw, and many rgw tests/benches. - Because of
add_dependencies(rgw_common rgw-lancedb), all of those links wait for the cargo build (7–20 min). When it finishes, make starts them all at once. With Ubuntu's default-flto=auto, each LTO link also spawns one ltrans worker per CPU.
At the OOM, the kernel log shows 20–30 concurrent ld processes and hundreds of lto1-ltrans/lto1-wpa-stream workers. The RGW targets are what's linking.
Data (node_exporter, peak memory used during the build stage, jammy/noble x86_64 default, soko/adami)¶
| late Aug – 09-17 | 09-18 – 10-20 | 10-22 / 10-23 | |
|---|---|---|---|
| jammy median / p90 | 136 / ~160 GiB | ~175 / ~220 GiB | ~230 / ~245 GiB |
| noble median / p90 | ~122 / ~134 GiB | ~125 / ~137 GiB | ~240 / ~248 GiB |
- The jammy step lines up exactly with the first main build that compiled lancedb (d2a865b, the day after the s3vectors merge, PR 66066).
- noble crossed the line around 10-21. The peak varies a lot between runs of the same sha (136 → 233 GiB), depending on how many RGW links are released together. The vector-bucket branch (PR 72180) peaked at 234–242 GiB on noble before it merged.
- The kernel OOM-kill counter on these builders was zero from 08-24 to 10-16, apart from two isolated events.
Suggested fix¶
Link rgw_lancedb only into the targets that serve s3vectors, not PUBLIC on rgw_common. That removes both the per-link weight and the synchronized link burst. If that isn't practical, a build-side workaround is to cap LTO parallelism for deb builds (e.g. -flto=8 in debian/rules) or lower the job count in make-debs.sh.
SB Updated by Sepia Bot about 1 month ago
- Assignee set to Yuval Lifshitz
- Priority changed from Normal to Urgent
YW Updated by Yuri Weinstein about 1 month ago
- Blocks QA Run #82053: wip-yuri16-testing-20261130.200516-main (wip-yuri16-testing-20261118.152653-main, wip-yuri16-testing-20261117.175722-main, wip-yuri16-testing-20261111.204903-main, wip-yuri16-testing-20261026.172747-main, wip-yuri16-testing-20261023.202320-main) added
YW Updated by Yuri Weinstein about 1 month ago
- Blocks QA Run #81975: wip-yuri10-testing-20261026.172809-main (wip-yuri10-testing-20261022.145333-main, wip-yuri10-testing-20261021.221632-main) added
KC Updated by Kefu Chai about 1 month ago
created https://github.com/ceph/ceph/pull/73067 to address. Yuval, sorry for hijacking this change. i created the PR before seeing this tracker ticket.
MH Updated by Matthew Heler about 1 month ago
- Status changed from New to Fix Under Review
- Pull request ID set to 73088
MH Updated by Matthew Heler about 1 month ago
There are a few candidate solutions here.
I did some digging, and the Noble and Jammy builds started failing in https://github.com/ceph/ceph/pull/72180 , I believe this is due to the fact the RadosVectorBucket became a subclass of RadosBucket with an inline destructor. Every rgw file that deletes a Bucket gets a copy of that destructor, and each copy needs RadosStore, so even the small rgw test and tool binaries now link most of rgw_common. That makes every rgw link heavier, and the debs are the ones that tip over. Before that merge, jammy and noble passed every time on the 264 GiB builders, and since then they mostly fail, while the rpm builds still pass on the same builders. Defining the destructor out of line, like RadosBucket's, should fix it,
https://github.com/ceph/ceph/pull/73088 was tested and merged which resolves this immediate issue.
MH Updated by Matthew Heler about 1 month ago
- Status changed from Fix Under Review to Resolved
UB Updated by Upkeep Bot about 1 month ago
- Merge Commit set to c3a0c6f194110f5f51f817a782085f03fb68e969
- Fixed In set to v21.3.0-4924-gc3a0c6f194
- Upkeep Timestamp set to 2026-10-28T00:46:35+00:00