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

Fix nodetool ring and status output format for IPv6 addresses

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 1.2.4
    • Component/s: Tool/nodetool
    • Labels:
      None

      Description

      My pedantic nature can't stand having unaligned columns in nodetool outputs, which happens when IP addresses are IPv6 ones:

      michal@aperture$ nodetool -h myhost status
      Datacenter: DC1
      ==================
      Status=Up/Down
      |/ State=Normal/Leaving/Joining/Moving
      --  Address           Load       Owns (effective)  Host ID                               Token                                    Rack
      UN  2001:3c27:21:166:0:1:2:7  331.65 GB  100,0%            d557fb83-72f2-4e92-9f26-de6c788aada5  85070591730234615865843651857942052864   rack2
      UN  2001:3c27:21:166:0:1:1:7  328.8 GB   100,0%            0461a4bf-97a6-447d-9d06-3b42ad1f702c  0                                        rack1
      

      I'm attaching a patch that fixes this problem for nodetool status / ring commands. It does it by picking first item in nodes list (for nodetool ring it's first node in general, for nodetool status it's first node in each DC) and uses its length as a field length for output.

      It bases on assumptions that it's imppossible to have 0 nodes in cluster/DC and the lenghts of addresses are "similar". The alternative I'm considering too is finding the longest address - it will be 100% accurate.

        Attachments

        1. 5302.patch
          4 kB
          Michał Michalski
        2. 5302-v2.patch
          4 kB
          Michał Michalski

          Activity

            People

            • Assignee:
              michalm Michał Michalski
              Reporter:
              michalm Michał Michalski
              Authors:
              Michał Michalski
              Reviewers:
              Brandon Williams
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: