Bug 1001040 - "ERROR: could not find mountpoint for brick directory" while setting tuned profile to brick directory with hyphen.
"ERROR: could not find mountpoint for brick directory" while setting tuned pr...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: storage-server-tools (Show other bugs)
2.1
Unspecified Unspecified
high Severity urgent
: ---
: ---
Assigned To: Bala.FA
Gowrishankar Rajaiyan
: ZStream
Depends On:
Blocks: 1001887
  Show dependency treegraph
 
Reported: 2013-08-26 07:36 EDT by Gowrishankar Rajaiyan
Modified: 2015-11-22 21:57 EST (History)
10 users (show)

See Also:
Fixed In Version: redhat-storage-server-2.1.0.2-1.el6rhs
Doc Type: Bug Fix
Doc Text:
Previously, a hyphen in the volume name would cause the tuned profile to fail. Tuned profiles tried to find bricks in a volume using the directory tree under /var/lib/glusterd/vols. The fix probes the bricks correctly using the volume configuration files, making the tuned profiles to work as expected even if a volume name has a hyphen.
Story Points: ---
Clone Of:
: 1001887 (view as bug list)
Environment:
Last Closed: 2013-12-09 11:45:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gowrishankar Rajaiyan 2013-08-26 07:36:48 EDT
Description of problem: Error detected while setting tuned profile to a volume name which has hyphen in it.


Version-Release number of selected component (if applicable):
RHS-2.1-20130820.n.0

How reproducible: Always


Steps to Reproduce:
1. Install RHS 2.1 
2. Create volume with hyphen in it. "glance-volume, in this case"
3. Set tuned profile.

Actual results:
[root@localhost ~]# tuned-adm profile rhs-virtualization
Reverting to saved sysctl settings:                        [  OK  ]
Calling '/etc/ktune.d/tunedadm.sh stop': setting readahead to 128 on brick devices: ERROR: could not find mountpoint for brick directory /rhs/bricks/cinder
ERROR: could not find mountpoint for brick directory /rhs/bricks/glance

                                                           [  OK  ]
Reverting to cfq elevator: dm-0 dm-1 dm-2 dm-3             [  OK  ]
Stopping tuned:                                            [  OK  ]
Switching to profile 'rhs-virtualization'
Applying ktune sysctl settings:
/etc/ktune.d/tunedadm.conf:                                [  OK  ]
Calling '/etc/ktune.d/tunedadm.sh start': setting readahead to 4096 on brick devices: ERROR: could not find mountpoint for brick directory /rhs/bricks/cinder
ERROR: could not find mountpoint for brick directory /rhs/bricks/glance

                                                           [  OK  ]
Applying sysctl settings from /etc/sysctl.conf
Applying deadline elevator: dm-0 dm-1 dm-2 dm-3            [  OK  ]
Starting tuned:                                            [  OK  ]
[root@localhost ~]# 


Expected results: Tuned profile should be set correctly. ERROR's should not be detected.


Additional info:

This happens because of "ls | grep $ipaddr | awk -F: '{ print $2 }' | sed 's/\-/\//g'" which replaces "-" to "/"
Comment 1 Gowrishankar Rajaiyan 2013-08-26 07:45:16 EDT
(In reply to Gowrishankar Rajaiyan from comment #0)
> Description of problem: Error detected while setting tuned profile to a
> volume name which has hyphen in it.
> 

Correction: Error detected while setting tuned profile if the brick directory has "hyphen" in it. glance-volume and cinder-volume in this case.
Comment 2 Ben England 2013-08-27 13:28:53 EDT
Is there any way to work around the problem by not using a hyphen in the brick directory name?  How about using an underscore or a dot?

To understand this problem, see the set_brick_ra() subroutine within /etc/tune-profiles/rhs-virtualization/ktune.sh:  

ls | grep `hostname -s` | awk -F: '{ print $2 }' | sed 's/\-/\//g' >> $bricklist

The entries in this directory /var/lib/glusterd/vols/your-volume/bricks/ look like this:

gprfs045-10ge:-mnt-brick0-brick  
gprfs047-10ge:-mnt-brick0-brick
gprfs046-10ge:-mnt-brick0-brick  
gprfs048-10ge:-mnt-brick0-brick

So the grep command selects the local host's bricks, the awk command filters out the hostname.  The directory path for the brick is encoded by Gluster replacing "/" with "-".  This is a poor choice because a filename can have a "-" in it, so this much is a Gluster bug.  The script is trying to convert back to a path specification for the brick directory with the sed command, but this doesn't work because the brick directory's filename has a "-" character in it.

My only other option AFAIK is to parse the /var/lib/glusterd/vols/$volume/${volume}-fuse.vol file.  If you need this fixed now and the workaround won't do, you have to let me know ASAP.
Comment 3 Gowrishankar Rajaiyan 2013-08-27 16:14:33 EDT
I don't see a work around to the problem here. Using an underscore or a dot or no special characters is a way to evade the issue and would have to be documented as a known issue or am I missing the work around ?
Comment 4 Bala.FA 2013-08-27 20:40:14 EDT
This fix is available at https://code.engineering.redhat.com/gerrit/12059.

Ben, could you help on reviewing this patch?
Comment 6 Sachidananda Urs 2013-09-05 05:16:39 EDT
Since this is not a blocker, we will move this to future?
Comment 7 Ben England 2013-09-09 13:00:54 EDT
Can we at least get it into RHS 2.1U1 and RHS 2.0U6?
Comment 8 Gowrishankar Rajaiyan 2013-10-03 05:52:52 EDT
Reverting fixed in version.
Comment 9 Gowrishankar Rajaiyan 2013-10-03 07:59:18 EDT
Volume Name: shanks-verify_bug1001040
Type: Replicate
Volume ID: 65f45568-88ad-4213-87d8-1942f64b8c5a
Status: Created
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.70.34.68:/rhs1/shanks-verify_bug.1001040
Brick2: 10.70.34.56:/rhs1/shanks-verify_bug.1001040


[root@ninja ~]# tuned-adm profile rhs-virtualization
Stopping tuned:                                            [  OK  ]
Switching to profile 'rhs-virtualization'
Applying ktune sysctl settings:
/etc/ktune.d/tunedadm.conf:                                [  OK  ]
Calling '/etc/ktune.d/tunedadm.sh start': setting readahead to 4096 on brick devices:  dm-2 dm-3 dm-3
                                                           [  OK  ]
Applying sysctl settings from /etc/sysctl.conf
Applying deadline elevator: dm-0 dm-1 dm-2 dm-3 sda        [  OK  ]
Starting tuned:                                            [  OK  ]
[root@ninja ~]# 


Verified redhat-storage-server-2.1.0.3-1.el6rhs.noarch
Comment 10 Pavithra 2013-10-29 06:38:55 EDT
hi Bala,

Please review the edited doc text (for errata) and sign off on its technical accuracy.

Thank you.
Comment 11 Bala.FA 2013-10-29 06:49:15 EDT
Looks good to me.

Note You need to log in before you can comment on or make changes to this bug.