Bug 1665211

Summary: Rework way getaddrinfo results are handled
Product: Red Hat Enterprise Linux 8 Reporter: Jan Friesse <jfriesse>
Component: corosyncAssignee: Jan Friesse <jfriesse>
Status: CLOSED CURRENTRELEASE QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: ccaulfie, cfeist, cluster-maint, mnovacek, rhandlin
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: corosync-3.0.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 02:05:35 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:
Embargoed:
Attachments:
Description Flags
2019-01-10-0001-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4 none

Description Jan Friesse 2019-01-10 17:02:25 UTC
Description of problem:
As described in bug 1659269 and bug 1654630 corosync has quite a few problems with reliable resolve of hostname. We used to have a quite good solution which was working most of the time, but it was still not perfect a may require changes in corosync.conf.

Luckily PCS guys were able to come with better solution which will solve both bugs at once without need to edit corosync.conf and forcing ip order.

Steps to Reproduce - problem described in bug 1659269:
1. /etc/hosts contains
1.2.3.4  test-node

2. corosync.conf contains
...
nodelist {
    node {
        ring0_addr: test-node
        name: test-node
        nodeid: 1
    }
...

3. hostname is set to test-node

Actual results:
Corosync will not start as long as:
- ip_version field in corosync.conf is not changed to ipv4
- or ring0_addr: test-node is not replaced by actual ip address
- or "myhostname" is not removed from nsswitch.conf

Problem described in bug 1654630 doesn't happen

Expected results:
1. Corosync will start successfully if conditions for bug 1659269 are configured
2. Problem described in bug 1654630 doesn't reappear

Additional info:

Comment 2 Jan Friesse 2019-01-10 17:08:11 UTC
Created attachment 1519878 [details]
2019-01-10-0001-totemip-Use-AF_UNSPEC-for-ipv4-6-and-ipv6-4

totemip: Use AF_UNSPEC for ipv4-6 and ipv6-4

AF_UNSPEC returns different results than AF_INET/AF_INET6, because of
nsswitch.conf search is in order and it stops asking other
modules once current module success.

Example of difference between previous and new code when ipv6-4 is used:
- /etc/hosts contains test_name with an ipv4
- previous code called AF_INET6 where /etc/hosts failed so other methods
were used which may return IPv6 addr -> result was ether fail or IPv6
address.
- new code calls AF_UNSPEC returning IPv4 defined in /etc/hosts ->
result is IPv4 address

New code behavior should solve problems caused by nss-myhostname.

Signed-off-by: Jan Friesse <jfriesse>

Comment 6 michal novacek 2019-02-16 11:59:27 UTC
Marking verified as this is a dependence of bug 1654630 which is already VERIFIED for this version of corosync-3.0.0-2.el8.