Project

General

Profile

Bug #1891

monclient: try ipv6 if ipv4 fails

Added by Josh Durgin almost 12 years ago. Updated almost 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When a hostname is specified, and it has an A and AAAA record, only the ipv4 address is tried.

If this fails, the ipv6 address should be tried instead. Wido provided a test program:

    root@stack01:~# ./rados_over_ipv6
    server name not found: ?.F? (Success)
    rados_connect failed: -22root@stack01:~# c^C
    root@stack01:~# cat rados_over_ipv6.c
    #include <stdio.h>
    #include "rados/librados.h" 

    int main(void) {

            rados_t cluster;

            int r;

            r = rados_create(&cluster, "admin");
            if (r < 0) {
                    printf("rados_create failed: %d", r);
                    return -1;
            }

            //rados_conf_set(cluster, "auth_supported", "cephx");
            rados_conf_set(cluster, "mon_host", "monitor.ceph.widodh.nl");
            //rados_conf_set(cluster, "keyring", "/etc/ceph/keyring.bin");

            r = rados_connect(cluster);
            if (r < 0) {
                    printf("rados_connect failed: %d", r);
                    return -2;
            }

            rados_shutdown(cluster);

    }
    root@stack01:~#

Associated revisions

Revision f09b21ef (diff)
Added by Sage Weil almost 12 years ago

resolve_addrs: return ipv4 and ipv6 addrs

Fixes: #1891
Signed-off-by: Sage Weil <>

History

#1 Updated by Sage Weil almost 12 years ago

I wonder if changing MonClient::build_initial_monmap() to put both the A and AAAA records in the search pool is sufficient. It doesn't let you do "prefer ipv6" because we're randomly trying provided monitors until we can connect, but it gets us most of the way there. And currently at least, the monitor will only bind to one or the other explicitly anyway.

#2 Updated by Sage Weil almost 12 years ago

  • translation missing: en.field_position set to 3

#3 Updated by Sage Weil almost 12 years ago

  • Target version deleted (v0.41)
  • translation missing: en.field_position deleted (11)
  • translation missing: en.field_position set to 5

#4 Updated by Sage Weil almost 12 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF