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

Log in 3.2 when client metadata is received

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.2.20
    • 3.2.21
    • Logging
    • None
    • Fully Compatible

    Description

      SERVER-24611 (et al) implemented client metadata in 3.4+. Before upgrading the server from 3.2 to 3.4, users must first upgrade their drivers. However, since 3.2 lacks support for client metadata, verifying that all connecting drivers have been upgraded might be difficult.

      This ticket is to request that 3.2 logs when a driver supplies client metadata in the isMaster command (but without bothering doing any parsing, verification, or later usage, etc). This will allow users to verify that drivers have been correctly upgraded prior to upgrading the server. I'm imagining very simple code along these lines (and similar in s/commands/cluster_is_master_cmd.cpp):

      diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp
      index 50e8480..034c954 100644
      --- a/src/mongo/db/repl/replication_info.cpp
      +++ b/src/mongo/db/repl/replication_info.cpp
      @@ -215,26 +215,31 @@ public:
           CmdIsMaster() : Command("isMaster", true, "ismaster") {}
           virtual bool run(OperationContext* txn,
                            const string&,
                            BSONObj& cmdObj,
                            int,
                            string& errmsg,
                            BSONObjBuilder& result) {
               /* currently request to arbiter is (somewhat arbitrarily) an ismaster request that is not
                  authenticated.
               */
               if (cmdObj["forShell"].trueValue())
                   LastError::get(txn->getClient()).disable();
       
      +        BSONElement element = cmdObj["client"];
      +        if (!element.eoo()) {
      +            log << "client supplied metadata: " << element.jsonString(false);
      +        }
      +
               appendReplicationInfo(txn, result, 0);
       
               if (serverGlobalParams.configsvrMode == CatalogManager::ConfigServerMode::CSRS) {
                   result.append("configsvr", 1);
               } else if (serverGlobalParams.configsvrMode == CatalogManager::ConfigServerMode::SCCC) {
                   result.append("configsvr", 0);
               }
       
               result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
               result.appendNumber("maxMessageSizeBytes", MaxMessageSizeBytes);
               result.appendNumber("maxWriteBatchSize", BatchedCommandRequest::kMaxWriteBatchSize);
               result.appendDate("localTime", jsTime());
               result.append("maxWireVersion", WireSpec::instance().maxWireVersionIncoming);
      

      Attachments

        Issue Links

          Activity

            People

              kevin.pulo@mongodb.com Kevin Pulo
              kevin.pulo@mongodb.com Kevin Pulo
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: