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

Make getDocumentKey get the shardKeyPattern from collectionPtr instead of asking the CSS every time

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding EMEA 2022-11-28
    • 132

    Description

      SERVER-69435 made obtaining the CollectionShardingState more costly, as it now needs to lock a mutex. This introduced a performance regression on some write paths – particularly the insert path. This is because getDocumentKey is called for every document in the batch, and every time getDocumentKey will obtain the CollectionShardingState.
      It is unnecessary to get the CSS for every document in the batch. Instead, it can be obtained only once for the operation and use it for every document in the batch.

      Attachments

        Activity

          People

            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: