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

ReshardCollection with small maxTimeMS can crash the shard due to incorrect BSON object lifetime

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0, 5.0.6, 5.2.1
    • Affects Version/s: 5.0.0, 5.2.0, 5.1.0
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • Hide

      repro.patch

      ./buildscripts/resmoke.py run --storageEngine=wiredTiger --storageEngineCacheSizeGB=.50 --suite=sharding  jstests/sharding/repro.js --log=file
      
      Show
      repro.patch ./buildscripts/resmoke.py run --storageEngine=wiredTiger --storageEngineCacheSizeGB=.50 --suite=sharding jstests/sharding/repro.js --log=file
    • Sharding EMEA 2021-12-27

      _shardsvrReshardCollection constructs a ReshardCollectionCoordinator passing as argument 'request()', which contains non-owned BSON objects (in particular, 'key' and 'collation'. ReshardCollectionCoordinator makes a copy of the ShardsvrReshardCollection object, but the mentioned BSON objects are still unowned. Thus, if ReshardCollectionCoordinator outlives the _shardsvrReshardCollection command, a crash can happen because the underlying bson objects are dangling.

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

              Created:
              Updated:
              Resolved: