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

Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization

    • Fully Compatible
    • ALL
    • v7.0, v6.0, v5.0
    • Sharding NYC 2023-06-26
    • 135

      After SERVER-60466, a mongod started with --shardsvr but does not yet have a shard identity would temporarily use the replica set version of the LogicalTimeValidator, which would later get replaced by sharded version of the LogicalTimeValidator during sharding initialization. The LogicalTimeValidator is a unique pointer decoration on the ServiceContext. As a result, once the replica set LogicalTimeValidator is replaced by the sharded replica set. The replica set LogicalTimeValidator object would become invalid and could lead to segmentation fault as seen in BF-29030. One resolution would be to make the LogicalTimeValidator a shared_ptr decoration so threads that have the replica set LogicalTimeValidator while sharding initialization occurs can continue to use it until they are done.

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: