Bug 1595176

Summary: gluster-blockd traceback seen with creation of a block with size specified in nB (bytes)
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Sweta Anandpara <sanandpa>
Component: tcmu-runnerAssignee: Xiubo Li <xiubli>
Status: CLOSED ERRATA QA Contact: Sweta Anandpara <sanandpa>
Severity: high Docs Contact:
Priority: unspecified    
Version: cns-3.10CC: bgoyal, pkarampu, pprakash, prasanna.kalever, rhs-bugs, sanandpa, sankarshan, vbellur, xiubli
Target Milestone: ---   
Target Release: CNS 3.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tcmu-runner-1.2.0-21.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-12 09:26:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1470955, 1545049, 1568862    

Description Sweta Anandpara 2018-06-26 09:52:40 UTC
Description of problem:
=======================
Had a 4node cluster with glusterfs-3.8.4-54.12 and gluster-block-0.2.1-20 and tcmu-runner-1.2.0-20. Was verifying BZ 1470955 when I tried executing a block create with size specified in bytes (for e.g., 512B). And the block creation failed. Below traceback was seen in /var/log/messages. Size specified (>512) in just numbers succeeds. Size (>512) suffixed with 'B' fails with a traceback.

Version-Release number of selected component (if applicable):
==============================================================[root@dhcp35-120 ~]# rpm -qa | grep gluster
glusterfs-cli-3.8.4-54.12.el7rhgs.x86_64
glusterfs-libs-3.8.4-54.12.el7rhgs.x86_64
glusterfs-rdma-3.8.4-54.12.el7rhgs.x86_64
libvirt-daemon-driver-storage-gluster-3.9.0-14.el7_5.5.x86_64
vdsm-gluster-4.17.33-1.2.el7rhgs.noarch
gluster-nagios-addons-0.2.10-2.el7rhgs.x86_64
glusterfs-api-3.8.4-54.12.el7rhgs.x86_64
glusterfs-geo-replication-3.8.4-54.12.el7rhgs.x86_64
gluster-nagios-common-0.2.4-1.el7rhgs.noarch
glusterfs-client-xlators-3.8.4-54.12.el7rhgs.x86_64
glusterfs-server-3.8.4-54.12.el7rhgs.x86_64
gluster-block-0.2.1-20.el7rhgs.x86_64
glusterfs-3.8.4-54.12.el7rhgs.x86_64
python-gluster-3.8.4-54.12.el7rhgs.noarch
glusterfs-fuse-3.8.4-54.12.el7rhgs.x86_64
[root@dhcp35-120 ~]# rpm -qa | grep tcmu
libtcmu-1.2.0-20.el7rhgs.x86_64
tcmu-runner-1.2.0-20.el7rhgs.x86_64
[root@dhcp35-120 ~]# rpm -qa | grep targetcli
targetcli-2.1.fb46-6.el7_5.noarch
[root@dhcp35-120 ~]# rpm -qa | grep configshell
python-configshell-1.1.fb23-4.el7_5.noarch
[root@dhcp35-120 ~]# rpm -qa | grep rtslib
python-rtslib-2.1.fb63-12.el7_5.noarch
[root@dhcp35-120 ~]# 


How reproducible:
=================
2:2


Steps to Reproduce:
====================
1. Have a 3 node cluster with brick mux enabled, create a X3 volume, and set the volume option to group 'gluster-block'.
2. Execute 'gluster-block create <volname>/<blockname> ha 2 <node1>,<node2>  1000B'


Actual results:
===============
Block create fails.
Traceback seen in /var/log/messages

Sosreports and gluster-blockd logs will be copied at: http://rhsqe-repo.lab.eng.blr.redhat.com/sosreports/swetas/<bugnumber>

Expected results:
=================
Block create should succeed, as long as the size specified is greater than 512bytes. 'B' if it stands for 'bytes' should be accepted, or at least handled gracefully, if it stands for something else. 


Additional info:
================

Jun 26 15:05:29 dhcp35-147 tcmu-runner[15650]: add_device:486 : handler open failed for uio2
Jun 26 15:05:29 dhcp35-147 tcmu-runner: 2018-06-26 15:05:29.966 15650 [ERROR] add_device:486 : handler open failed for uio2
Jun 26 15:05:30 dhcp35-147 python: detected unhandled Python exception in '/usr/bin/targetcli'
Jun 26 15:05:30 dhcp35-147 abrt-server: Package 'targetcli' isn't signed with proper key
Jun 26 15:05:30 dhcp35-147 abrt-server: 'post-create' on '/var/spool/abrt/Python-2018-06-26-15:05:30-1031' exited with 1
Jun 26 15:05:30 dhcp35-147 abrt-server: Deleting problem directory '/var/spool/abrt/Python-2018-06-26-15:05:30-1031'
Jun 26 15:05:30 dhcp35-147 gluster-blockd: Traceback (most recent call last):
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/bin/targetcli", line 122, in <module>
Jun 26 15:05:30 dhcp35-147 gluster-blockd: main()
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/bin/targetcli", line 112, in main
Jun 26 15:05:30 dhcp35-147 gluster-blockd: shell.run_interactive()
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
Jun 26 15:05:30 dhcp35-147 gluster-blockd: self._cli_loop()
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
Jun 26 15:05:30 dhcp35-147 gluster-blockd: self.run_cmdline(cmdline)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
Jun 26 15:05:30 dhcp35-147 gluster-blockd: self._execute_command(path, command, pparams, kparams)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
Jun 26 15:05:30 dhcp35-147 gluster-blockd: result = target.execute_command(command, pparams, kparams)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
Jun 26 15:05:30 dhcp35-147 gluster-blockd: return method(*pparams, **kparams)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 610, in ui_command_create
Jun 26 15:05:30 dhcp35-147 gluster-blockd: hw_max_sectors=hw_max_sectors, control=control)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/rtslib_fb/tcm.py", line 823, in __init__
Jun 26 15:05:30 dhcp35-147 gluster-blockd: self._configure(config, size, wwn, hw_max_sectors, control)
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/rtslib_fb/tcm.py", line 841, in _configure
Jun 26 15:05:30 dhcp35-147 gluster-blockd: self._enable()
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/rtslib_fb/tcm.py", line 171, in _enable
Jun 26 15:05:30 dhcp35-147 gluster-blockd: fwrite(path, "1\n")
Jun 26 15:05:30 dhcp35-147 gluster-blockd: File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 79, in fwrite
Jun 26 15:05:30 dhcp35-147 gluster-blockd: file_fd.write(str(string))
Jun 26 15:05:30 dhcp35-147 gluster-blockd: IOError: [Errno 2] No such file or directory

Comment 7 Xiubo Li 2018-06-27 06:13:44 UTC
For the scsi block device, the tcmu-runner will round down the device size to the block_size(such as 512 bytes), but the gluster file in the backend allows the file size not aligns to the block_size. 

So when the block device is being created in tcmu-runner the glfs handler will check the sizes which are not match and fails it.

Here is a fix PR in the upstream code:
https://github.com/open-iscsi/tcmu-runner/pull/437

Thanks,

Comment 11 Prasanna Kumar Kalever 2018-07-05 06:56:55 UTC
PRS:
https://github.com/gluster/gluster-block/pull/91 (review)
https://github.com/open-iscsi/tcmu-runner/pull/437 (Merged)

Comment 16 errata-xmlrpc 2018-09-12 09:26:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:2691