Bug 1023099

Summary: optimize fs-lib.sh based filesystem monitor code
Product: Red Hat Enterprise Linux 6 Reporter: David Vossel <dvossel>
Component: resource-agentsAssignee: David Vossel <dvossel>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.6CC: agk, cluster-maint, fdinitto, jharriga, mnovacek, nkshirsa
Target Milestone: rcFlags: nkshirsa: needinfo?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-3.9.2-45.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:59:32 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:
Attachments:
Description Flags
optimize fs monitoring with mktemp for write testing
none
optimize fs monitoring with mktemp for write testing none

Description David Vossel 2013-10-24 15:33:57 UTC
Description of problem:

fs-lib.sh's is_alive function attempts to determine if a filesystem resource is healthy by writing and reading a file from disk.  The method used to pick the file name involves a infinite loop where we try different file names until we get one that doesn't exist.  We don't need to be doing that... Instead we should create a unique filename based on the resource's instance name and use that for testing.

Comment 3 David Vossel 2013-10-25 03:20:53 UTC
Created attachment 815990 [details]
optimize fs monitoring with mktemp for write testing

This patch removes the loop for a single call to mktemp.

Comment 4 Fabio Massimo Di Nitto 2013-10-25 03:55:37 UTC
+		file=$(mktemp "$mount_point/check_writable.XXXXXX")

best if file is hidden and contains the hostname /.check_writable.$(hostname).XXXXXX

this avoid a potential problem for clusterfs without posix locks where two nodes could theoretically create the same file.

Comment 5 David Vossel 2013-10-25 15:10:47 UTC
Created attachment 816216 [details]
optimize fs monitoring with mktemp for write testing

uploaded new patch that makes file hidden and includes hostname

Comment 7 David Vossel 2014-04-22 22:23:14 UTC
Unit testing.

No special case needs to be verified for this. This is an optimization. Sanity checking that a fs-lib.sh based file system resource (such as fs.sh) can properly start, monitor, and stop a filesystem is enough.  No behavior change is expected.

-- Vossel

Comment 8 michal novacek 2014-05-07 14:34:27 UTC
I have verified that the filesystem resource behaves as expect  with 
resource-agents-3.9.2-47.el6.x86_64.

Comment 9 errata-xmlrpc 2014-10-14 04:59:32 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.

http://rhn.redhat.com/errata/RHBA-2014-1428.html