Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31094

Mongos should fail gracefully when pointing to a featureCompatibilityVersion 3.6 cluster

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code, Sharding
    • None
    • Storage 2017-10-02

      This is continuation of SERVER-29428:

      When pointing a 3.4 mongos at a featureCompatibilityVersion=3.6 cluster, the mongos spins, logging:
      remote host has incompatible wire version: IncompatibleServerVersion: Server
      min and max wire version are incompatible (6,6) with client min wire version
      (5,5)
      Instead, the processes should quickly exit with a non-zero exit code and a useful error message. The error message should display a "MustUpgrade" error code and should link to the documentation for the 3.4=>3.6 upgrade process.

      This is not possible because mongos uses a DBConnectionPool, which uses a MongoURI that does not return a status code, but sets an error string. MongoURI::connect should return a StatusWith<DBClientConnection> to determine the reason for connection failure, which can be checked in Refresher::_refreshUntilMatches in replica_set_monitor.cpp

      DBClientBase* DBConnectionPool::get(const MongoURI& uri, double socketTimeout) {
           std::unique_ptr<DBClientBase> c(_get(uri.toString(), socketTimeout));
           if (c) {
               onHandedOut(c.get());
               return c.release();
           }
      
           string errmsg;
           c = std::unique_ptr<DBClientBase>(uri.connect(StringData(), errmsg, socketTimeout));
           uassert(40356, _name + ": connect failed " + uri.toString() + " : " + errmsg, c);
      
           return _finishCreate(uri.toString(), socketTimeout, c.release());
      }
      

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: