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

ReservedTimes object not instantiated in global index observer

    • Fully Compatible
    • ALL
    • Sharding EMEA 2023-01-09

      The ReservedTimes class is a raii-type that on destruction makes sure there are no more times reserved for operations by observers.

      After SERVER-67123 a new observer was added for the global indexes catalog but it is missing the ReservedTimes object, which causes the following behavior:

      Suppose you have a command that executes any of the functions in the global index catalog API. These functions do some calls that might reserve some times and then they call the forementioned observer so by the time the function finishes, the reservedTimes vector might be holding some times. If later on in the same thread/opCtx, another function calls an observer (like for example, another write), then the insert observer will instantiate a ReservedTimes and that will hit the invariant protection the class have in the constructor.

            Assignee:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Reporter:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: