Skip to content

rgw/lua: fix a crash when D4N is enabled - #67638

Merged
yuvalif merged 1 commit into
ceph:mainfrom
nbalacha:wip-nbalacha-75306
Mar 12, 2026
Merged

yuvalif merged 1 commit into
ceph:mainfrom
nbalacha:wip-nbalacha-75306

Conversation

@nbalacha

@nbalacha nbalacha commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

This change addresses a crash in Lua which happens when the lua Background is not set in the LuaManager. Specifically, this occurs when rgw_filter is set to d4n, as the env.driver is not the rados driver in that scenario.

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

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.

This change addresses a crash in Lua which happens when the lua
Background is not set in the LuaManager. Specifically, this occurs
when rgw_filter is set to d4n, as the env.driver is not the rados
driver in that scenario.

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

Signed-off-by: Nithya Balachandran <[email protected]>
@nbalacha
nbalacha requested a review from a team as a code owner March 4, 2026 06:24
@github-actions github-actions Bot added the rgw label Mar 4, 2026
@nbalacha

nbalacha commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

This addresses one part of the problem where the RadosLuaManager does not check if the lua_background is actually set before accessing it.
The underlying issue is that env.driver is a FilterDriver driver when rgw_filter is not "none", even if the actual StoreDriver is rados. The AppMain code performs various init and shutdown ops (lua, dedup) depending on whether the env.driver is the rados driver instead of checking all the drivers to see if one of them is the rados driver.

@nbalacha
nbalacha requested a review from yuvalif March 4, 2026 09:08
@yuvalif

yuvalif commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

This addresses one part of the problem where the RadosLuaManager does not check if the lua_background is actually set before accessing it. The underlying issue is that env.driver is a FilterDriver driver when rgw_filter is not "none", even if the actual StoreDriver is rados. The AppMain code performs various init and shutdown ops (lua, dedup) depending on whether the env.driver is the rados driver instead of checking all the drivers to see if one of them is the rados driver.

with your fix, there will be no crash for non-rados drivers.
in case of filter drivers that has rados in their linked list (e.g. d4n), or that implement the lua manager.
of for non-rados drivers that implement the lua manager, we would need to change the appmain code so it does not check for ther driver name, instead we add proper sal APIs for either detecting for whether the background is supported or use the manager as a factory for the background.
note that lua is still mostly functional without its background (no package reloads, no bytecode optimization and no background context or table).

@yuvalif
yuvalif merged commit 7f3756d into ceph:main Mar 12, 2026
16 of 19 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/23010660934

@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
4 of 14 tasks
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.

2 participants