On Thu, 2007-12-27 at 15:47 -0600, James Richardson wrote:
> Ian,
> 
>  
> 
> I updated your patch a little to provide clearer debug output in the
> 'add_host' function. I've attached the patch to this e-mail. (I'm
> still getting familiar with git, my apologies if the diff is not in
> the correct format). I updated the logerr call in replicated.c to:
> 
>  
> 
> logerr("add host %s address %s", host, inet_ntoa(*((struct in_addr
> *)phe->h_addr)));

Yep, my bad.

> 
>  
> 
> Below is the output after my simple 'ls' test. It is interesting that
> 'add host large-rr address 172.21.15.37' line is called 48 times -
> there are 48 entries in the large-rr round robin – I would have
> assumed it would have called it for each address in the round robin,
> not 48 times for the same address.

Yes, but I think phe->h_addr is the first address in the list.
And that's exactly what it should do.
I wonder what I've got wrong here.
Let me look a bit further.

> 
>  
> 
>  
> 
>  
> 
> Dec 27 15:36:26 myhost autofs: automount startup succeeded
> 
> Dec 27 15:36:30 myhost automount[15117]: add_host_addrs:886:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost automount[15117]: add_host_addrs:902: add host
> large-rr address 172.21.15.37
> 
> Dec 27 15:36:30 myhost last message repeated 47 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:30 myhost last message repeated 2 times
> 
> Dec 27 15:36:30 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:31 myhost last message repeated 2 times
> 
> Dec 27 15:36:31 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_udp_client:96:
> gethostbyname_r large-rr
> 
> Dec 27 15:36:32 myhost last message repeated 2 times
> 
> Dec 27 15:36:32 myhost automount[15117]: create_tcp_client:308:
> gethostbyname_r large-rr
> 
>  
> 
>  
> 
> ---
> 
> James T. Richardson, Jr.
> 
> [EMAIL PROTECTED]
> 
> eXcellence in IS Solutions, Inc.
> 
> 713-862-9200 x226
> 
>  
> 
> Making IT Work for You
> 
> HPC & Enterprise IT Solutions
> 
> • HPC Application Acceleration
> 
> • Cluster Design, Deploy, Manage, Train
> 
> • Linux/Windows Integration
> 
> • Remote Management, Backup, Anti-Spam/Virus
> 
> • Network Assessments, Design
> 
> • Security Audits, Design
> 
> • Datacenter Design, Relocation
> 
> • Messaging and Collaboration
> 
>  
> 
>  
> 
> -----Original Message-----
> From: Ian Kent [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 27, 2007 1:08 AM
> To: James Richardson
> Cc: Jeff Moyer; [email protected]
> Subject: RE: [autofs] Slow mounts when using large round robin sets
> 
>  
> 
> On Wed, 2007-12-26 at 16:15 -0600, James Richardson wrote:
> 
> > Dec 26 16:00:02 myhost automount[3060]: add_host_addrs:885:
> 
> > gethostbyname_r large-rr
> 
> > 
> 
> > Dec 26 16:00:02 myhost automount[3060]: add_host_addrs:901: add host
> 
> > address ÀTm·ÈTm·ÐTm·ØTm·àTm·èTm·ðTm·øTm·
> 
>  
> 
> I obviously have a mistake in the patch but I still need to know
> what's
> 
> going on so could you try again with this patch please.
> 
>  
> 
> ---
> 
> diff --git a/include/rpc_subs.h b/include/rpc_subs.h
> 
> index 3292e01..14b459f 100644
> 
> --- a/include/rpc_subs.h
> 
> +++ b/include/rpc_subs.h
> 
> @@ -46,6 +46,7 @@
> 
>  
> 
>  struct conn_info {
> 
>       const char *host;
> 
> +     const char *addr;
> 
>       unsigned short port;
> 
>       unsigned long program;
> 
>       unsigned long version;
> 
> @@ -61,7 +62,7 @@ int rpc_udp_getclient(struct conn_info *, unsigned
> int, unsigned int);
> 
>  void rpc_destroy_udp_client(struct conn_info *);
> 
>  int rpc_tcp_getclient(struct conn_info *, unsigned int, unsigned
> int);
> 
>  void rpc_destroy_tcp_client(struct conn_info *);
> 
> -int rpc_portmap_getclient(struct conn_info *, const char *, const
> char *, unsigned int);
> 
> +int rpc_portmap_getclient(struct conn_info *, const char *, const
> char *, const char *, unsigned int);
> 
>  unsigned short rpc_portmap_getport(struct conn_info *, struct pmap
> *);
> 
>  int rpc_ping_proto(struct conn_info *);
> 
>  int rpc_ping(const char *, long, long, unsigned int);
> 
> diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
> 
> index 5797639..cc632a4 100644
> 
> --- a/lib/rpc_subs.c
> 
> +++ b/lib/rpc_subs.c
> 
> @@ -66,6 +66,7 @@ static CLIENT *create_udp_client(struct conn_info
> *info)
> 
>       struct hostent *php = &hp;
> 
>       struct hostent *result;
> 
>       char buf[HOST_ENT_BUF_SIZE];
> 
> +     const char *haddr;
> 
>       size_t len;
> 
>  
> 
>       if (info->proto->p_proto != IPPROTO_UDP)
> 
> @@ -86,11 +87,13 @@ static CLIENT *create_udp_client(struct conn_info
> *info)
> 
>       memset(&raddr, 0, sizeof(raddr));
> 
>  
> 
>       raddr.sin_family = AF_INET;
> 
> -     if (inet_aton(info->host, &raddr.sin_addr))
> 
> +     haddr = info->addr ? info->addr : info->host;
> 
> +     if (inet_aton(haddr, &raddr.sin_addr))
> 
>             goto got_addr;
> 
>  
> 
>       memset(&hp, 0, sizeof(struct hostent));
> 
>  
> 
> +     logerr("gethostbyname_r %s", info->host);
> 
>       ret = gethostbyname_r(info->host, php,
> 
>                   buf, HOST_ENT_BUF_SIZE, &result, &ghn_errno);
> 
>       if (ret || !result) {
> 
> @@ -276,6 +279,7 @@ static CLIENT *create_tcp_client(struct conn_info
> *info)
> 
>       struct hostent *php = &hp;
> 
>       struct hostent *result;
> 
>       char buf[HOST_ENT_BUF_SIZE];
> 
> +     const char *haddr;
> 
>       int ret;
> 
>  
> 
>       if (info->proto->p_proto != IPPROTO_TCP)
> 
> @@ -295,11 +299,13 @@ static CLIENT *create_tcp_client(struct
> conn_info *info)
> 
>       memset(&addr, 0, sizeof(addr));
> 
>  
> 
>       addr.sin_family = AF_INET;
> 
> -     if (inet_aton(info->host, &addr.sin_addr))
> 
> +     haddr = info->addr ? info->addr : info->host;
> 
> +     if (inet_aton(haddr, &addr.sin_addr))
> 
>             goto got_addr;
> 
>  
> 
>       memset(&hp, 0, sizeof(struct hostent));
> 
>  
> 
> +     logerr("gethostbyname_r %s", info->host);
> 
>       ret = gethostbyname_r(info->host, php,
> 
>                   buf, HOST_ENT_BUF_SIZE, &result, &ghn_errno);
> 
>       if (ret || !result) {
> 
> @@ -407,7 +413,7 @@ void rpc_destroy_tcp_client(struct conn_info
> *info)
> 
>  }
> 
>  
> 
>  int rpc_portmap_getclient(struct conn_info *info,
> 
> -                   const char *host, const char *proto,
> 
> +                   const char *host, const char *addr, const char
> *proto,
> 
>                     unsigned int option)
> 
>  {
> 
>       struct protoent *pe_proto;
> 
> @@ -418,6 +424,7 @@ int rpc_portmap_getclient(struct conn_info *info,
> 
>             return 0;
> 
>  
> 
>       info->host = host;
> 
> +     info->addr = addr;
> 
>       info->program = PMAPPROG;
> 
>       info->port = PMAPPORT;
> 
>       info->version = PMAPVERS;
> 
> @@ -462,6 +469,7 @@ unsigned short rpc_portmap_getport(struct
> conn_info *info, struct pmap *parms)
> 
>             client = info->client;
> 
>       else {
> 
>             pmap_info.host = info->host;
> 
> +           pmap_info.addr = info->addr;
> 
>             pmap_info.port = PMAPPORT;
> 
>             pmap_info.program = PMAPPROG;
> 
>             pmap_info.version = PMAPVERS;
> 
> @@ -589,6 +597,7 @@ static unsigned int __rpc_ping(const char *host,
> 
>       struct pmap parms;
> 
>  
> 
>       info.host = host;
> 
> +     info.addr = NULL;
> 
>       info.program = NFS_PROGRAM;
> 
>       info.version = version;
> 
>       info.send_sz = 0;
> 
> @@ -769,6 +778,7 @@ exports rpc_get_exports(const char *host, long
> seconds, long micros, unsigned in
> 
>       int status;
> 
>  
> 
>       info.host = host;
> 
> +     info.addr = NULL;
> 
>       info.program = MOUNTPROG;
> 
>       info.version = MOUNTVERS;
> 
>       info.send_sz = 0;
> 
> diff --git a/modules/replicated.c b/modules/replicated.c
> 
> index 90b2925..daa4531 100644
> 
> --- a/modules/replicated.c
> 
> +++ b/modules/replicated.c
> 
> @@ -437,7 +437,7 @@ static unsigned int get_nfs_info(unsigned logopt,
> struct host *host,
> 
>  v3_ver:
> 
>       if (!have_port_opt) {
> 
>             status = rpc_portmap_getclient(pm_info,
> 
> -                       host->name, proto, RPC_CLOSE_DEFAULT);
> 
> +                       host->name, host->addr, proto,
> RPC_CLOSE_DEFAULT);
> 
>             if (!status)
> 
>                   goto done_ver;
> 
>       }
> 
> @@ -551,6 +551,7 @@ static int get_vers_and_cost(unsigned logopt,
> struct host *host,
> 
>             timeout = RPC_TIMEOUT * 8;
> 
>  
> 
>       rpc_info.host = host->name;
> 
> +     rpc_info.addr = host->addr;
> 
>       rpc_info.program = NFS_PROGRAM;
> 
>       rpc_info.timeout.tv_sec = timeout;
> 
>       rpc_info.close_option = RPC_CLOSE_DEFAULT;
> 
> @@ -606,6 +607,7 @@ static int get_supported_ver_and_cost(unsigned
> logopt, struct host *host,
> 
>             timeout = RPC_TIMEOUT * 8;
> 
>  
> 
>       rpc_info.host = host->name;
> 
> +     rpc_info.addr = host->addr;
> 
>       rpc_info.program = NFS_PROGRAM;
> 
>       rpc_info.timeout.tv_sec = timeout;
> 
>       rpc_info.close_option = RPC_CLOSE_DEFAULT;
> 
> @@ -652,7 +654,7 @@ static int get_supported_ver_and_cost(unsigned
> logopt, struct host *host,
> 
>                   return 0;
> 
>       } else {
> 
>             int ret = rpc_portmap_getclient(&pm_info,
> 
> -                       host->name, proto, RPC_CLOSE_DEFAULT);
> 
> +                       host->name, host->addr, proto,
> RPC_CLOSE_DEFAULT);
> 
>             if (!ret)
> 
>                   return 0;
> 
>  
> 
> @@ -880,6 +882,7 @@ static int add_host_addrs(struct host **list,
> const char *host, unsigned int wei
> 
>       memset(buf, 0, MAX_IFC_BUF);
> 
>       memset(&he, 0, sizeof(struct hostent));
> 
>  
> 
> +     logerr("gethostbyname_r %s", host);
> 
>       ret = gethostbyname_r(host, phe,
> 
>                   buf, MAX_IFC_BUF, &result, &ghn_errno);
> 
>       if (ret || !result) {
> 
> @@ -895,6 +898,7 @@ static int add_host_addrs(struct host **list,
> const char *host, unsigned int wei
> 
>             if (prx == PROXIMITY_ERROR)
> 
>                   return 0;
> 
>  
> 
> +           logerr("add host %s address %s", host, *haddr);
> 
>             if (!(new = new_host(host, *haddr, prx, weight)))
> 
>                   return 0;
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 
> NOTICE:
> This message may contain privileged or otherwise confidential information.
> If you are not the intended recipient, please immediately advise the sender
> by reply email and delete the message and any attachments without using,
> copying or disclosing the contents.

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to