Cassandra
  1. Cassandra
  2. CASSANDRA-5002

UUIGen should never use another host IP for its node part

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 rc1
    • Component/s: None
    • Labels:
      None

      Description

      UUIDGen allows to specify the inet address that we use to generate the node part of the created UUID. This is wrong however. More precisely, the node part is what make sure UUID generated on two different hosts are different, because we can't guarantee that the timestamp and clock parts will be different. In other words, generating on a host a UUID with the node part of another host is dangerous is clearly contrary to the spec.

      And as it turns out, making sure we always use the local address means that the full lsb part of the UUID becomes constant (as it should) and we can remove the nodeCache from UUIDGen and simplify/speedup UUID generation, which is all the more reason to fix it.

      I note that we were almost always using the local address to generate UUID anyway. The only place where we weren't is in Stream

      {In/Out}

      Session, and there is virtually no chance that this has ever broke anything (but we should still fix it).

      1. 5002.txt
        19 kB
        Sylvain Lebresne

        Activity

        Sylvain Lebresne created issue -
        Sylvain Lebresne made changes -
        Field Original Value New Value
        Attachment 5002.txt [ 12555348 ]
        Sylvain Lebresne made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.2.0 rc1 [ 12323481 ]
        Fix Version/s 1.2.0 [ 12323243 ]
        Hide
        Jonathan Ellis added a comment -

        I'm pretty sure the first part of getAllLocalAddresses (the getAllByName list) will be a subset of the ones seen by getNetworkInterfaces' addresses. (We do this in CFRR too – would make sense to extract it somewhere.)

        Otherwise +1.

        Show
        Jonathan Ellis added a comment - I'm pretty sure the first part of getAllLocalAddresses (the getAllByName list) will be a subset of the ones seen by getNetworkInterfaces' addresses. (We do this in CFRR too – would make sense to extract it somewhere.) Otherwise +1.
        Sylvain Lebresne made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Reviewer jbellis
        Resolution Fixed [ 1 ]
        Hide
        Sylvain Lebresne added a comment -

        You're right, the getAllByName part is probably useless. I've move the getNetworkInterfaces part in FBUtilities (and used it in CFRR and UUIDGen) and committed. Thanks.

        Show
        Sylvain Lebresne added a comment - You're right, the getAllByName part is probably useless. I've move the getNetworkInterfaces part in FBUtilities (and used it in CFRR and UUIDGen) and committed. Thanks.
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12736252 ] patch-available, re-open possible [ 12753639 ]
        Gavin made changes -
        Workflow patch-available, re-open possible [ 12753639 ] reopen-resolved, no closed status, patch-avail, testing [ 12758848 ]

          People

          • Assignee:
            Sylvain Lebresne
            Reporter:
            Sylvain Lebresne
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development