Skip to content

ceph-bluestore-tool: Fixes for multilple bdev label - #59762

Merged
aclamk merged 5 commits into
ceph:mainfrom
aclamk:wip-aclamk-cbt-combined
Sep 25, 2024
Merged

aclamk merged 5 commits into
ceph:mainfrom
aclamk:wip-aclamk-cbt-combined

Conversation

@aclamk

@aclamk aclamk commented Sep 12, 2024 •

Copy link
Copy Markdown
Contributor

This PR consists of:

ZAP:
#59632
show-label:
#59714
really-really-mean-it:
#59627
+
-zap-size param is removed
+
documentation added

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

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Comment thread doc/man/8/ceph-bluestore-tool.rst Outdated

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.

The label is a 4KB structure at the beginning of the device that serves as a superblock, holding metadata including version, creation time, size, etc. There are copies at offsets 1GB, 10GB, 100GB, and 1000GB. The label may be printed while an OSD is running.

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.

Isn't this redundant wrt existing text around lines 203 / 211?

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.

it feels to me this change should actually be moved to section Device labels

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right.
I will move detailed explanation around "Device labels" section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@anthonyeleven Please recheck. My PRs always benefit from your language input.

@aclamk
aclamk force-pushed the wip-aclamk-cbt-combined branch from 87eec9f to d58f730 Compare September 12, 2024 15:57
Comment thread src/os/bluestore/BlueStore.cc Outdated
Comment on lines 9000 to 9001

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.

suggest using smart pointers here:
unique_ptr<BlockDevice> _bdev(BlockDevice::create(cct, dev, nullptr, nullptr, nullptr, nullptr));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good one. Done.

@guits guits 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.

reviewed from a ceph-volume/orchestration point of view.

tested with a cephadm deployed cluster:

show-label on running OSD:

[root@bluestore-tests-1 /]# ceph osd tree
ID  CLASS  WEIGHT   TYPE NAME                   STATUS  REWEIGHT  PRI-AFF
-1         0.19530  root default
-3         0.19530      host bluestore-tests-1
 0    hdd  0.19530          osd.0                   up   1.00000  1.00000
[root@bluestore-tests-1 /]# ceph-bluestore-tool show-label --dev /dev/ceph-f895bb03-9590-46e7-be60-f2aa39965576/osd-block-e06e7091-ad93-436b-8cff-9bc45bebe672
{
    "/dev/ceph-f895bb03-9590-46e7-be60-f2aa39965576/osd-block-e06e7091-ad93-436b-8cff-9bc45bebe672": {
        "osd_uuid": "e06e7091-ad93-436b-8cff-9bc45bebe672",
        "size": 214744170496,
        "btime": "2024-09-13T08:29:22.110570+0000",
        "description": "main",
        "bfm_blocks": "52427776",
        "bfm_blocks_per_key": "128",
        "bfm_bytes_per_block": "4096",
        "bfm_size": "214744170496",
        "bluefs": "1",
        "ceph_fsid": "efc6b532-71a9-11ef-bf2c-525400c3b0c0",
        "ceph_version_when_created": "ceph version 19.3.0-4916-g3e18128d (3e18128dc8e02730bc1b3e7530b4fbb543f81eef) squid (dev)",
        "created_at": "2024-09-13T08:29:25.624292Z",
        "elastic_shared_blobs": "1",
        "epoch": "18",
        "kv_backend": "rocksdb",
        "magic": "ceph osd volume v026",
        "multi": "yes",
        "osd_key": "AQDg9+NmJWGcMhAA99mv/fZte7DwR/L+9X00jA==",
        "osdspec_affinity": "None",
        "ready": "ready",
        "require_osd_release": "19",
        "type": "bluestore",
        "whoami": "0"
    }
}
[root@bluestore-tests-1 /]#

ceph-bluestore-tool zap-device:

[root@bluestore-tests-1 /]# ceph orch daemon stop osd.0
Scheduled to stop osd.0 on host 'bluestore-tests-1'

[root@bluestore-tests-1 /]# ceph osd tree
ID  CLASS  WEIGHT   TYPE NAME                   STATUS  REWEIGHT  PRI-AFF
-1         0.19530  root default
-3         0.19530      host bluestore-tests-1
 0    hdd  0.19530          osd.0                 down   1.00000  1.00000

[root@bluestore-tests-1 /]# hexdump -C -n22 -s1073741824 /dev/ceph-f895bb03-9590-46e7-be60-f2aa39965576/osd-block-e06e7091-ad93-436b-8cff-9bc45bebe672
40000000  62 6c 75 65 73 74 6f 72  65 20 62 6c 6f 63 6b 20  |bluestore block |
40000010  64 65 76 69 63 65                                 |device|
40000016

[root@bluestore-tests-1 /]# ceph-bluestore-tool zap-device --dev /dev/ceph-f895bb03-9590-46e7-be60-f2aa39965576/osd-block-e06e7091-ad93-436b-8cff-9bc45bebe672 --yes-i-really-really-mean-it

[root@bluestore-tests-1 /]# hexdump -C -n22 -s1073741824 /dev/ceph-f895bb03-9590-46e7-be60-f2aa39965576/osd-block-e06e7091-ad93-436b-8cff-9bc45bebe672
40000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
40000010  00 00 00 00 00 00                                 |......|
40000016
[root@bluestore-tests-1 /]#

Make zapping precisely target block device labels.

Signed-off-by: Adam Kupczyk <[email protected]>
@aclamk
aclamk force-pushed the wip-aclamk-cbt-combined branch from d58f730 to cec3792 Compare September 13, 2024 10:37
Comment thread doc/man/8/ceph-bluestore-tool.rst Outdated

@ifed01 ifed01 Sep 13, 2024 •

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.

That's not <osd path> but <dev path>.

And it's to be provided with --dev option. One can even specify multiple devices this way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread doc/man/8/ceph-bluestore-tool.rst Outdated

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.

same here

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.

by the way, shouldn't it be zap-device ?

Suggested change
:command: `zap` --path *osd path*
:command: `zap-device` --path *osd path*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

- added zap documentation
- explained show-label lock exclusion

Signed-off-by: Adam Kupczyk <[email protected]>
@aclamk
aclamk force-pushed the wip-aclamk-cbt-combined branch from cec3792 to afeaeb7 Compare September 13, 2024 13:09
@YiteGu

YiteGu commented Sep 14, 2024

Copy link
Copy Markdown
Member

jenkins test make check

@guits

guits commented Sep 16, 2024

Copy link
Copy Markdown
Contributor

jenkins test api

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.

5 participants