Project

General

Profile

Actions

Bug #1891

closed

monclient: try ipv6 if ipv4 fails

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

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

0%

Source:
Tags:
Backport:
Regression:
Severity:
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:~#
Actions #1

Updated by Sage Weil over 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.

Actions #2

Updated by Sage Weil over 12 years ago

  • Translation missing: en.field_position set to 3
Actions #3

Updated by Sage Weil over 12 years ago

  • Target version deleted (v0.41)
  • Translation missing: en.field_position deleted (11)
  • Translation missing: en.field_position set to 5
Actions #4

Updated by Sage Weil over 12 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF