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

Record the real messaging version in all cases in OutboundTcpConnection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.0.11, 2.1.1
    • None
    • None
    • Low

    Description

      Piotr's quote, from CASSANDRA-6700 description:

      IncomingTcpConnection#handleModernVersion sets version to min(my version, version of the peer). This messes up schema pull/push.

      Seems like we've missed a similar, yet related, case in OutboundTcpConnection#connect():

      if (targetVersion < maxTargetVersion && targetVersion < MessagingService.current_version)
      {
          logger.trace("Detected higher max version {} (using {}); will reconnect when queued messages are done",
                  maxTargetVersion, targetVersion);
          MessagingService.instance().setVersion(poolReference.endPoint(), Math.min(MessagingService.current_version, maxTargetVersion));
          softCloseSocket();
      }
      

      Should really set the true version (maxTargetVersion), since MessagingService#getVersion() will return the min for us, anyway:

      public int getVersion(InetAddress endpoint)
      {
          Integer v = versions.get(endpoint);
          if (v == null)
          {
              // we don't know the version. assume current. we'll know soon enough if that was incorrect.
              logger.trace("Assuming current protocol version for {}", endpoint);
              return MessagingService.current_version;
          }
          else
              return Math.min(v, MessagingService.current_version);
      }
      

      But we need the true version for schema exchange decisions.

      Attachments

        1. 8057.txt
          1 kB
          Aleksey Yeschenko

        Issue Links

          Activity

            People

              aleksey Aleksey Yeschenko
              aleksey Aleksey Yeschenko
              Aleksey Yeschenko
              Piotr Kolaczkowski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: