Bug 548476

Summary: automount cannot use rpc ping to select from list of replicated servers
Product: Red Hat Enterprise Linux 5 Reporter: Sachin Prabhu <sprabhu>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: cward, ikent, jmoyer, jwest, kvolny, rrajaram, tao
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: autofs-5.0.1-0.rc2.137.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 563772 (view as bug list) Environment:
Last Closed: 2010-03-30 08:37:26 UTC Type: ---
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: 563772    
Attachments:
Description Flags
Patch - fix random selection option
none
Patch - fix random selection option (corrected) none

Description Sachin Prabhu 2009-12-17 15:15:15 UTC
Instead of using the server with the best RPC ping time, automount always selects the server randomly.

The -r option for autofs is not set.

/var/log/messages with autofs debug enabled in /etc/sysconfig/autofs:

Dec 10 17:04:12 xxxxxx automount[25958]: get_nfs_info: called for host server4 proto udp version 0x30 
Dec 10 17:04:12 xxxxxx automount[25958]: get_nfs_info: nfs v3 random selection time: 0.949207 
Dec 10 17:04:12 xxxxxx automount[25958]: get_nfs_info: nfs v2 random selection time: 0.505903 
Dec 10 17:04:12 xxxxxx automount[25958]: get_nfs_info: host server4 cost 727555 weight 0 

master_parser.y:
    816 	entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT;

This is apparently set unconditionally so it looks like there is no
way to unset this flag.

Comment 2 Sachin Prabhu 2009-12-17 15:16:24 UTC
Patch proposed by Ian.

autofs-5.0.5 - fix random selection option

From: Ian Kent <raven themaw net>

When parsing the master map we fail to check if the random selection
option has been seen and set the random selection option unconditionally.
---

 lib/master_parse.y |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/lib/master_parse.y b/lib/master_parse.y
index 8ca7df7..2db483b 100644
--- a/lib/master_parse.y
+++ b/lib/master_parse.y
@@ -806,7 +806,8 @@ int master_parse_entry(const char *buffer, unsigned
int default_timeout, unsigne
                                ops->timeout(ap->logopt, ap->ioctlfd,
&tout);
                }
        }
-       entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT;
+       if (random_select)
+               entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT;
        if (negative_timeout)
                entry->ap->negative_timeout = negative_timeout;

Comment 3 Ian Kent 2009-12-17 15:47:32 UTC
Created attachment 379016 [details]
Patch - fix random selection option

Proposed patch without email wrap.

Comment 5 Ian Kent 2009-12-18 04:39:42 UTC
Created attachment 379149 [details]
Patch -  fix random selection option (corrected)

Oops!

Comment 14 Chris Ward 2010-02-11 10:21:19 UTC
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~

RHEL 5.5 Beta has been released! There should be a fix present in this 
release that addresses your request. Please test and report back results 
here, by March 3rd 2010 (2010-03-03) or sooner.

Upon successful verification of this request, post your results and update 
the Verified field in Bugzilla with the appropriate value.

If you encounter any issues while testing, please describe them and set 
this bug into NEED_INFO. If you encounter new defects or have additional 
patch(es) to request for inclusion, please clone this bug per each request
and escalate through your support representative.

Comment 19 errata-xmlrpc 2010-03-30 08:37:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0265.html