Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-3211

Enhanced IP resolution for machines with multiple network interfaces

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 0.8.7
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mac OS X and Linux with machines that have multiple network interfaces whereby the IP associated with the split is not on the network interface associated with localhost.

      Description

      On unix machines that have multiple network interfaces whereby the IP associated with the split is not on the network interface associated with localhost, the getLocation method cannot find the proper IP and throws an exception "no connection available".

      I changed the implementation to use NetworkInterface instead of InetAddress using getLocalHost().

      This is more reliable. See the following references:
      http://stackoverflow.com/questions/5813194/inetaddress-getlocalhost-does-not-return-expected-ip-address-from-c-windows-sy
      http://stackoverflow.com/questions/4871451/inetaddress-getlocalhost-returns-wrong-result-when-hostname-is-64-chars
      http://www.jguru.com/faq/view.jsp?EID=790132

      1. trunk-3211.txt
        3 kB
        Brian ONeill

        Activity

        Hide
        boneill Brian ONeill added a comment -

        Patch Attached.

        Show
        boneill Brian ONeill added a comment - Patch Attached.
        Hide
        boneill Brian ONeill added a comment -

        Patch attached to issue.

        Show
        boneill Brian ONeill added a comment - Patch attached to issue.
        Hide
        jbellis Jonathan Ellis added a comment -

        committed, thanks!

        Show
        jbellis Jonathan Ellis added a comment - committed, thanks!
        Hide
        hudson Hudson added a comment -

        Integrated in Cassandra-0.8 #357 (See https://builds.apache.org/job/Cassandra-0.8/357/)
        check all interfaces for a match with split location before falling back to random replica
        patch by Brian ONeill; reviewed by jbellis for CASSANDRA-3211

        jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1178554
        Files :

        • /cassandra/branches/cassandra-0.8/CHANGES.txt
        • /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
        Show
        hudson Hudson added a comment - Integrated in Cassandra-0.8 #357 (See https://builds.apache.org/job/Cassandra-0.8/357/ ) check all interfaces for a match with split location before falling back to random replica patch by Brian ONeill; reviewed by jbellis for CASSANDRA-3211 jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1178554 Files : /cassandra/branches/cassandra-0.8/CHANGES.txt /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java

          People

          • Assignee:
            boneill Brian ONeill
            Reporter:
            boneill Brian ONeill
            Reviewer:
            Jonathan Ellis
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development