ceph-bluestore-tool: Fixes for multilple bdev label#59762
Conversation
Fixes: https://tracker.ceph.com/issues/67926 Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
ceph-volume needs to query the devices for `ceph-volume raw list`. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
doc/man/8/ceph-bluestore-tool.rst
Outdated
| Show device label(s). Label is a special 4K area that plays the role of superblock, | ||
| provides metadata that exposes version, creation time, size, etc. | ||
| There are multiple copies of the block at offsets: 0, 1G, 10G, 100G and 1000G. | ||
| As an exception, label can be printed even if an OSD is running. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Isn't this redundant wrt existing text around lines 203 / 211?
There was a problem hiding this comment.
it feels to me this change should actually be moved to section Device labels
There was a problem hiding this comment.
Right.
I will move detailed explanation around "Device labels" section.
There was a problem hiding this comment.
@anthonyeleven Please recheck. My PRs always benefit from your language input.
87eec9f to
d58f730
Compare
src/os/bluestore/BlueStore.cc
Outdated
| auto * _bdev = | ||
| BlockDevice::create(cct, dev, nullptr, nullptr, nullptr, nullptr); |
There was a problem hiding this comment.
suggest using smart pointers here:
unique_ptr<BlockDevice> _bdev(BlockDevice::create(cct, dev, nullptr, nullptr, nullptr, nullptr));
There was a problem hiding this comment.
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 <akupczyk@ibm.com>
d58f730 to
cec3792
Compare
doc/man/8/ceph-bluestore-tool.rst
Outdated
| | **ceph-bluestore-tool** reshard --path *osd path* --sharding *new sharding* [ --sharding-ctrl *control string* ] | ||
| | **ceph-bluestore-tool** show-sharding --path *osd path* | ||
| | **ceph-bluestore-tool** trim --path *osd path* | ||
| | **ceph-bluestore-tool** zap --path *osd path* |
There was a problem hiding this comment.
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.
doc/man/8/ceph-bluestore-tool.rst
Outdated
| and allows the drive to perform more efficient internal housekeeping. | ||
| If BlueStore runs with discard enabled, this option may not be useful. | ||
|
|
||
| :command: `zap` --path *osd path* |
There was a problem hiding this comment.
by the way, shouldn't it be zap-device ?
| :command: `zap` --path *osd path* | |
| :command: `zap-device` --path *osd path* |
- added zap documentation - explained show-label lock exclusion Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
cec3792 to
afeaeb7
Compare
|
jenkins test make check |
|
jenkins test api |
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e