Bug #18269
closedrbd info truncates block_name_prefix to 23 chars
0%
Description
Hi,
Since 10.2.4/5 rbd info truncates the block_name_prefix to 23 chars. Version 10.2.3 shows the prefix with 24 chars. Also rbd status is affected and can't list the watchers. Creating RBDs with version 10.2.4/5 leads to RBDs with a block_name_prefix of 23 chars, as well.
The same image with different rbd client versions:
root@v10.2.5:~# rbd info 0ea7f52850cc851139d1118556a35f691230a0120e08795fd5ea398e779e865d rbd image '0ea7f52850cc851139d1118556a35f691230a0120e08795fd5ea398e779e865d': size 20480 MB in 5120 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.915a555238e1f2 format: 2 features: layering flags: root@v10.2.5:~# echo -n "rbd_data.915a555238e1f2" | wc -c 23
root@v10.2.3:~# rbd -p mesos info 0ea7f52850cc851139d1118556a35f691230a0120e08795fd5ea398e779e865d rbd image '0ea7f52850cc851139d1118556a35f691230a0120e08795fd5ea398e779e865d': size 20480 MB in 5120 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.915a555238e1f29 format: 2 features: layering flags: root@v10.2.3:~# echo -n "rbd_data.915a555238e1f29" | wc -c 24
I don't think this is the same problem as in #16887, where the block_name_prefix is 25 chars, which is larger than RBD_MAX_BLOCK_NAME_SIZE.
Regards,
Achim
Updated by Mykola Golub over 7 years ago
This has been changed when fixing this issue: http://tracker.ceph.com/issues/17310
I think we can return the old behavior for `rbd info` if backport new API get_block_name_prefix() function from this PR: https://github.com/ceph/ceph/pull/11353
Updated by Jason Dillaman over 7 years ago
The issue is that the legacy API only supports 23 characters (plus an additional null byte) to represent the block name prefix. Since there was a bug that did not properly restrict the block name prefix, lots of images in deployed clusters have block names that cannot be represented in via the existing API method.
I opened ticket #18270 to backport the new API methods (and deprecate the old one) which will fix this issue for you.