Bug 902216 - glusterd fails to identify peer while creating a new volume
Summary: glusterd fails to identify peer while creating a new volume
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterd
Version: 2.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: krishnan parthasarathi
QA Contact: SATHEESARAN
URL:
Whiteboard: glusterd
Depends On: 890502
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-21 07:34 UTC by Vidya Sakar
Modified: 2015-11-03 23:05 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 890502
Environment:
Last Closed: 2015-03-23 07:36:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Vidya Sakar 2013-01-21 07:34:36 UTC
+++ This bug was initially created as a clone of Bug #890502 +++

Description of problem:
If the peer happens to be probed on an ip address (instead of hostname), volume creation fails. To identify a friend, glusterd does a strcmp(hostname, peername). Since peername happens to be an ip address here (since we probed an ip-address instead of hostname), glusterd cannot identify hostname as friend (though it is one).

Backtrace:

Breakpoint 5, glusterd_friend_find_by_hostname (hoststr=0x7f03d8000eb0 "rhs-hpc-srv2", peerinfo=0x927128)
    at ../../../../../xlators/mgmt/glusterd/src/glusterd-utils.c:4589
4589                            if (!strncasecmp (entry->hostname, host,
(gdb) p entry->hostname
$8 = 0x6fa300 "192.168.1.14"
(gdb) l
4584                                       1024, NULL, 0, 0);
4585                    if (ret)
4586                            goto out;
4587
4588                    list_for_each_entry (entry, &priv->peers, uuid_list) {
4589                            if (!strncasecmp (entry->hostname, host,
4590                                1024) || !strncasecmp (entry->hostname,hname,
4591                                1024)) {
4592                                    gf_log (this->name, GF_LOG_DEBUG,
4593                                            "Friend %s found.. state: %d",
(gdb) p entry->hostname
$9 = 0x6fa300 "192.168.1.14"
(gdb) p hname
$10 = "rhs-hpc-srv2.lab.eng.blr.redhat.com", '\000' <repeats 988 times>

Version-Release number of selected component (if applicable):
master

How reproducible:
always

Steps to Reproduce:
1. 
2.
3.
  
Actual results:


Expected results:


Additional info: Ideally glusterd should be doing comparisions on ip-addresses instead of hostname. A rough algorithm would be,
1. getaddrinfo (hostname).
2. compare the list of addresses hostname resolves into with list of friends. The comparision should be done on ip-addresses, not on hostname.

Comment 3 Vivek Agarwal 2015-03-23 07:36:40 UTC
The product version of Red Hat Storage on which this issue was reported has reached End Of Life (EOL) [1], hence this bug report is being closed. If the issue is still observed on a current version of Red Hat Storage, please file a new bug report on the current version.







[1] https://rhn.redhat.com/errata/RHSA-2014-0821.html

Comment 4 Vivek Agarwal 2015-03-23 07:39:06 UTC
The product version of Red Hat Storage on which this issue was reported has reached End Of Life (EOL) [1], hence this bug report is being closed. If the issue is still observed on a current version of Red Hat Storage, please file a new bug report on the current version.







[1] https://rhn.redhat.com/errata/RHSA-2014-0821.html


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