Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3674

Investigate changes in SERVER-88142: Include collection type with `create` events.

    • Type: Icon: Investigation Investigation
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 51

      Original Downstream Change Summary

      Collection and view creation changestream events will now contain an additional field "operationDescription.type" with the type of the collection/view created.

      The new `type` field is placed inside the existing `operationDescription` object, so that the top-level fields for events do not change.

      The value for the `operationDescription.type` field is determined as follows:

      • if the original oplog entry is a "create" (collection) entry, then `operationDescription.type` will contain `collection`.
      • if the original oplog entry is a command that creates a timeseries collection with "viewOn" starting with `system.buckets.`), then `operationDescription.type` will contain `timeseries`.
      • if the original oplog entry is a command that creates a non-timeseries view (with "viewOn" being set but not starting with `system.buckets.`), then `operationDescription.type` will contain `view`.

      The new `operationDescription.type` field will only be returned if the changestream was opened with the `showExpandedEvents` flag.

      Description of Linked Ticket

      Currently `create` events offer no explicit indication of the type of the namespace that’s been created. Clients have to parse it heuristically:

      1. If there’s a collection UUID: type=collection.
      2. Otherwise, if viewOn is a system.buckets collection: type=timeseries.
      3. Otherwise, type=view.

      This means clients have to know about all collection types. So were there to be some new collection type, the logic above would process it as a view. Moreover, a client that doesn’t want to care about time-series collections nonetheless has to filter them out explicitly.

      It would seem better all around to add a “type” field to the event.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: