Skip to content

tools/ceph-kvstore-tool: fail store-copy cleanly when the store cannot be created - #72418

Merged
aainscow merged 3 commits into
ceph:mainfrom
aainscow:wip-kvstore-store-copy-type
Nov 16, 2026
Merged

aainscow merged 3 commits into
ceph:mainfrom
aainscow:wip-kvstore-store-copy-type

Conversation

@aainscow

@aainscow aainscow commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

ceph-kvstore-tool bluestore-kv <path> store-copy <dest> crashed with a segmentation fault. The target store type defaults to the source type, KeyValueDB::create() can only create rocksdb stores and returns nullptr for bluestore-kv (or any other type), and StoreTool::copy_store_to() dereferenced the result.

  • qa/workunits/cephtool: test_kvstore_tool.sh now expects store-copy without a store type to fail with a message naming bluestore-kv, and store-copy to rocksdb to copy every key. expect_false alone would also pass on the crash, so the test also checks the message.
  • tools/ceph-kvstore-tool: copy_store_to() returns -EINVAL with "cannot create a store of type ''; pass a store type such as rocksdb", and the usage text says that bluestore-kv needs the type.
  • doc/man: ceph-kvstore-tool.rst documents the store type argument of store-copy.

Testing: qa/workunits/cephtool/test_kvstore_tool.sh, run locally on a main build. With only the test commit it fails at the message check; running the same store-copy by hand ends in a segmentation fault (exit status 139) in StoreTool::copy_store_to(). With the fix it passes: store-copy without a type exits 1 with the message, and store-copy to rocksdb copies all 12 keys. The man page was not built.

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

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.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ETDivFUQubLqznTDowHRu

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@aainscow

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@aainscow
aainscow force-pushed the wip-kvstore-store-copy-type branch 2 times, most recently from be8e52f to 2328117 Compare October 27, 2026 15:22
@aainscow
aainscow force-pushed the wip-kvstore-store-copy-type branch from 2328117 to 1c7ac32 Compare October 27, 2026 15:27
@aainscow
aainscow marked this pull request as ready for review October 28, 2026 12:27
@aainscow
aainscow requested review from a team as code owners October 28, 2026 12:27
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath18-testing-20261029.065635-main.

@aainscow
aainscow force-pushed the wip-kvstore-store-copy-type branch from 1c7ac32 to 4bc9859 Compare October 29, 2026 14:25
…e type

'ceph-kvstore-tool bluestore-kv <path> store-copy <dest>' defaults the
destination store type to the source type. KeyValueDB::create cannot
create a bluestore-kv store and returns nullptr, which copy_store_to
then dereferences, so the tool dies with a segmentation fault.

Expect store-copy without a store type to fail with a message saying it
cannot create a bluestore-kv store, and store-copy to rocksdb to copy
every key. The tool segfaults on the current code.

Fixes: https://tracker.ceph.com/issues/81466
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
…t be created

'ceph-kvstore-tool bluestore-kv <path> store-copy <dest>' defaults the
destination store type to the source type, but KeyValueDB::create can
only create rocksdb stores and returns nullptr for bluestore-kv, which
copy_store_to then dereferenced.

Return -EINVAL with a message naming the type when KeyValueDB::create
fails, and say in the usage text that bluestore-kv needs the type.

Fixes: https://tracker.ceph.com/issues/81466
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow
aainscow force-pushed the wip-kvstore-store-copy-type branch from 4bc9859 to 85fb0f3 Compare November 6, 2026 08:54
@connorfawcett

Copy link
Copy Markdown
Contributor

@aainscow
aainscow merged commit 5759603 into ceph:main Nov 16, 2026
14 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/43841179606

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.

4 participants