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

Prevent segfaults over uninitialized OptionalRoutingTableHistory

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Sharding EMEA
    • Fully Compatible
    • Sharding EMEA 2023-07-10
    • 1

      The "OptionalRoutingTableHistory" can be a nullptr for unsharded collections inside of the ChunkManager->_rt. Could we add a more robust method of preventing callers from accidentally calling methods on an unsharded collection? Perhaps invarianting on isSharded() prior to executing the methods that require that to be true. I would prefer that over seg-faulting. 

      Currently, the only safe-guard against this is a small comment in the header file:
      https://github.com/10gen/mongo/blob/ff5e8a16decf26e412ed06261ec92d3bafe82a63/src/mongo/s/chunk_manager.h#L530

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            fausto.leyva@mongodb.com Fausto Leyva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: