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

Avoid useless initial iteration in ChunkMap chunks loops

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0, 7.1.0-rc2
    • Affects Version/s: 7.1.0-rc0
    • Component/s: None
    • Labels:
    • Fully Compatible
    • v7.1
    • Sharding EMEA 2023-09-04, Sharding EMEA 2023-09-18

      Here and here we use lower_bound instead of upper_bound to find the vector that contain the first chunk of the loop. The consequence is that when the start shard key is equal to the minKey of the first chunk of a vector, we will wrongly start iterating from the previous vector instead of the correct one.

      This does not actually cause any correctness issue because in both cases the logic afterward will simply skip the initial wrong vector because it doesn't actually contain the initial shard Key.
      In any case, this logic is wrong and should be fixed.

            tommaso.tocci@mongodb.com Tommaso Tocci
            tommaso.tocci@mongodb.com Tommaso Tocci
            0 Vote for this issue
            3 Start watching this issue