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

Remove keyPatternObj from splitChunk and splitChunkCommand logic

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor - P4 Minor - P4
    • None
    • 3.5.10
    • Sharding
    • Sharding

    Description

      The KeyPattern of a particular shard can be fetched using the following call.

      ScopedCollectionMetadata collMetada;
      KeyPattern shardKeyPattern(collMetadata->getKeyPattern());
      

      Hence, it is unnecessary that the split chunk command must take in a BSONObj called keyPatternObj, as in the following code block.

      BSONObj keyPatternObj;
      {
          BSONElement keyPatternElem;
          auto keyPatternStatus =
              bsonExtractTypedField(cmdObj, "keyPattern", Object, &keyPatternElem);
       
          if (!keyPatternStatus.isOK()) {
              errmsg = "need to specify the key pattern the collection is sharded over";
              return false;
          }
          keyPatternObj = keyPatternElem.Obj();
      }
      

      This keyPatternObj parameter can most likely be removed completely from the split chunk command.

      Attachments

        Activity

          People

            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            hugh.han Hugh Han
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: