RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2094828 - The resource-agent "lvmlockd" returns success in setup_lvm_config(), even if use_lvmlockd was not changed to 1. (RHEL9)
Summary: The resource-agent "lvmlockd" returns success in setup_lvm_config(), even i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: resource-agents
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.1
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 2086889
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-08 11:39 UTC by Oyvind Albrigtsen
Modified: 2022-12-01 13:38 UTC (History)
9 users (show)

Fixed In Version: resource-agents-4.10.0-17.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2086889
Environment:
Last Closed: 2022-11-15 09:44:01 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-124639 0 None None None 2022-06-08 11:50:30 UTC
Red Hat Knowledge Base (Solution) 6958415 0 None None None 2022-12-01 13:38:50 UTC

Description Oyvind Albrigtsen 2022-06-08 11:39:09 UTC
+++ This bug was initially created as a clone of Bug #2086889 +++

Description of problem:
The resource-agent  "lvmlockd"  returns success in setup_lvm_config(), even if use_lvmlockd was not changed to 1.

If "global/use_lvmlockd" is commented out or does not exist, then function setup_lvm_config() will still returns a success return code which implies that /etc/lvm/lvm.conf is properly configured. That function returns success no matter what occurs.

The main issue is that if the option "use_lvmlockd" is comment out or does not exist then when we use lvmconfig to check the current value then "cut" the output it will return an empty string and we never run sed commands to change the value from 0 to 1.

We need to do 2 things for when the "use_lvmlockd" is comment out:
  • Add another if check if there exists a line that is comment out: "# use_lvmlockd =" . Does not matter value as it is commented out, so would be default which is disabled. 
  • If so, need similar sed command that will change a commented out line to not use comments and enable use_lvmlockd. 

In addition:
  • If use_lvmlockd does not exist, then return error and log message saying that user needs to manually enable "use_lvmlockd".
  • Add a check that "use_lvmlockd" is enabled before function returns. If not enable, return success if enabled, otherwise return a failure. For example, log an error if "use_lvmlockd" does not equal 1 and not commented out after it was suppose to be enabled but was not. The details of error should inform the user to manually enable "use_lvmlockd". 
  

   
With that said, the above approach does not fix the case where the option does not exist and also assumes that if "sed" does find "use_lvmlockd" that "use_lvmlockd" is in the global section of /etc/lvm/lvm.conf. Ideally, we should request an RFE for "lvmconfig" to create some new options to enable/disable use_lvmlockd. 

----

Our current documentation states that user has to manually enable the option "use_lvmlockd" before creating the lvmlockd resource. I believe a better approach if possible is to have that step automated by the resource-agent lvmlockd. 

  - Chapter 7\. GFS2 file systems in a cluster Red Hat Enterprise Linux 8 | 7.1. Configuring a GFS2 file system in a cluster (Step 3)
    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_high_availability_clusters/assembly_configuring-gfs2-in-a-cluster-configuring-and-managing-high-availability-clusters)

Version-Release number of selected component (if applicable):
# rpm -qa | grep -ie resource-agents -ie lvm2 | sort
lvm2-2.03.14-3.el8.x86_64
lvm2-libs-2.03.14-3.el8.x86_64
lvm2-lockd-2.03.14-3.el8.x86_64
resource-agents-4.9.0-16.el8.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. Comment out "use_lvmlockd" in the /etc/lvm/lvm.conf
2. Create a lvmlockd resource


Actual results:
The option use_lvmlockd option is still commented out. This means that use_lvmlockd=0 (disabled).

Expected results:
The option use_lvmlockd option should return an error in setup_lvm_config() if the option "use_lvmlockd" in /etc/lvm/lvm.conf was not enabled.

Additional info:

Do note that "locking_type" option is not used (or possibly does not exist) on RHEL 8, so validating it is the correct value is not important, but we still might want to consider someway of validating "locking_type" in upstream like we do with "use_lvmlockd" proposed above for those clusters that do not support lvmlockd as an option. 

------

On a related issue, we should see if there is away to automate enabling/disabling "use_lvmlockd" via lvmconfig with an option like: # lvmconfig [--enable,--disable]_lvmlockd.

Currently we are using "sed" to enable "use_lvmlockd" if it is disable. The "sed" approach would not work if the option "use_lvmlockd" does not exist.

I think the best approach would be to open another bug for "lvm2" that will do the following:
  • Add option for lvmconfig to enable "use_lvmlockd":  lvmconfig --enable_lvmlockd.
  • Add option for lvmconfig to disable "use_lvmlockd": lvmconfig --disable_lvmlockd
  * Add ability somehow (unless already exists) for lvmconfig to be able to determine the value of "global/use_lvmlockd" when option is enabled, disable, comment out, or does not exist (the later two is ones I could not find a way to do).


https://github.com/ClusterLabs/resource-agents/pull/1777

Comment 9 errata-xmlrpc 2022-11-15 09:44:01 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 (resource-agents bug fix and enhancement update), 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/RHBA-2022:7932


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