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 1575973 - fence_scsi duplicates entries in /var/run/cluster/fence_scsi.dev on attribute change
Summary: fence_scsi duplicates entries in /var/run/cluster/fence_scsi.dev on attribute...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-08 12:46 UTC by Ondrej Faměra
Modified: 2021-12-10 16:07 UTC (History)
3 users (show)

Fixed In Version: fence-agents-4.0.11-89.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 07:49:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch to fix the issue (387 bytes, patch)
2018-05-08 12:46 UTC, Ondrej Faměra
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs fence-agents pull 203 0 None None None 2018-05-09 09:27:54 UTC
Red Hat Knowledge Base (Solution) 3435851 0 None None None 2018-05-08 13:16:09 UTC
Red Hat Product Errata RHBA-2018:3031 0 None None None 2018-10-30 07:50:13 UTC

Description Ondrej Faměra 2018-05-08 12:46:39 UTC
Created attachment 1433197 [details]
proposed patch to fix the issue

== Description of problem:
When fence_scsi stonith device configuration is updated the content of '/var/run/cluster/fence_scsi.dev'
gets partially duplicated and grows over time.

== Version-Release number of selected component (if applicable):
fence-agents-scsi-4.0.11-86.el7.x86_64

== How reproducible:
always

== Steps to Reproduce:
1. Create fence_scsi stonith device in pacemaker cluster with at least 2 devices in 'device' attribute
  # pcs stonith create scsi fence_scsi devices="/dev/sdb,/dev/sdc"
2. Update the 'scsi' stonith device by adding a new disk to list
  # pcs stonith update scsi devices="/dev/sdb,/dev/sdc,/dev/sdd"

== Actual results:
Content of the file '/var/run/cluster/fence_scsi.dev'
# cat /var/run/cluster/fence_scsi.dev
/dev/sdb
/dev/sdc
/dev/sdc
/dev/sdd

== Expected results:
Content of the file '/var/run/cluster/fence_scsi.dev'
# cat /var/run/cluster/fence_scsi.dev
/dev/sdb
/dev/sdc
/dev/sdd

== Additional info:
Running more updates results in more duplicate entries inside the file.

For example in above situation adding another disk would result in following content:
# pcs stonith update scsi devices="/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde"
# cat /var/run/cluster/fence_scsi.dev
/dev/sdb
/dev/sdc
/dev/sdc
/dev/sdd
/dev/sdc
/dev/sdd
/dev/sde

It seems that the function responsible for matching the device name doesn't match properly.
Applying following change to /usr/sbin/fence_scsi seems to resolve the problem and make the
devices to match properly.

--- /usr/sbin/fence_scsi	2018-02-07 16:53:44.000000000 +0100
+++ /usr/sbin/fence_scsi	2018-05-08 14:36:57.168000000 +0200
@@ -240,7 +240,7 @@
 	except IOError:
 		fail_usage("Failed: Cannot open file \""+ file_path + "\"")
 	out = f.read()
-	if not re.search(r"^" + dev + "\s+", out):
+	if not re.search(r"^" + dev + "\s+", out, flags=re.MULTILINE):
 		f.write(dev + "\n")
 	f.close()

Comment 7 errata-xmlrpc 2018-10-30 07:49:52 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/RHBA-2018:3031


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