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

Ensure memory associated with parsed DDL coordinator document is kept alive

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • ALL
    • 2

      I realized that we actually have the same problem for all the classes that extend the ShardingDDLCoordinator.
      Many of the classes that extend the ShardingDDLCoordinator  parse their coordinator document at construction time. On the other hand our parsing implementation doesn't take ownership of nested BSONObj if they are not defined as object_owned, so if the coordinator document contains any nested object that is not owned, the parsed coordinator doc stored as a member of the coordinator instance will point to invalid memory.
      I find this very error prone, so I was thinking to store a serialized copy of the raw coordinator document in the ShardingDDLCoordinator parent class so that we can ensure that the memory associated with all the fields in the parsed coordinator document will remain alive until the coordinator instance is destructed.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: