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

Investigate changes in SERVER-97071: Ensure stability of resumeTokens across versions

    • Type: Icon: Investigation Investigation
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator

      Original Downstream Change Summary

      SERVER-88142 introduced an additional subfield "type" inside the "operationDescription" field of "create" changestream events, in case that the changestream was opened with the "showExpandedEvents" flag set.

      It turned out that extending the "operationDescription" field with additional subfields is not a good idea, because the full "operationDescription" value is used to generate the resumeToken for the event.

      That means the resumeToken for a "create" event would be different depending on whether the new "type" field is produced or not. This could be a problem during upgrades.

      This PR reverts the changes from SERVER-88142, so that the "operationDescription" values for "create" changestream events will remain the same when upgrading from older versions to 8.1. The resumeTokens will remain fully compatible.

      To solve the original purpose of SERVER-88142, which was to expose the type of the created object in the changestream "create" event, the type will now be exposed in a new top-level field named "nsType", in case the changestream was opened with the "showExpandedEvents" flag. The "nsType" field will contain either "collection", "timeseries" or "view".

      Description of Linked Ticket

      SERVER-88142 introduced an additional subfield type inside the operationDescription of "create" changestream events, in case "showExpandedEvents" is used.

      This is fine as a new feature, but it turned out that the full operationDescription is used when generating resumeTokens.

      That means resumeTokens for a "create" event can differ depending on the server version, depending on whether or not the version generates the operationDescription.type subfield.

      One possible solution is to not take the new operationDescription.type subfield into account when generating resumeToken values, but it adds new complexity and opens up the possibility of forgetting to exclude the fields in different places of the code.

      A better solution would be to expose the value that's currently in operationDescription.type in a new top-level field, which will never be used for calculating resumeTokens.

      We should thus revert the changes from SERVER-88142 (which is fine because they have not been released yet), so that the operationDescription values for "create" changestream events will remain the same when upgrading from older versions to 8.1. The resumeTokens will then remain fully compatible.
      The "type" value should be exposed in a new top-level field named extra if the changestream was opened with the "showExpandedEvents" flag. The purpose of the extra field is to convey additional information for an event without affecting the resumeToken values.
      The extra field is new and currently only exposed for "create" events in case the expanded events are produced. It may be used in the future to return additional data for other events.

            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:
              Resolved: