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

Investigate changes in SERVER-84531: Inserting mixed-schema buckets through the system.buckets collection doesn't set the timeseriesBucketsMayHaveMixedSchemaData flag

    • Type: Icon: Investigation Investigation
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 3
    • TAR 2024-04-01, TAR 2024-04-15, TAR 2024-04-29, TAR 2024-05-13
    • Tools and Replicator
    • 1

      Original Downstream Change Summary

      timeseriesBucketsMayHaveMixedSchemaData is a new option which can be provided to the collMod command for a time-series collection. This option can only be set to true (cannot use false). Setting it to true sets an internal flag on the time-series collection indicating that it may contain buckets holding mixed-schema data. Mixed schema time-series buckets were only possible to be created on older versions such as v5.0.

      For time-series collections, some tools interface directly with the underlying buckets collection. If such a tool is used to restore old time-series data (inserted on v5.0 and containing mixed-schema buckets) into a new time-series collection, now inserting those old buckets may fail with a error code CannotInsertTimeseriesBucketsWithMixedSchema. If this error is received, use the new collMod option mentioned above. Then once the flag is set using collMod, the mixed-schema buckets can be successfully inserted.

      Description of Linked Ticket

      All newly created time-series collections have timeseriesBucketsMayHaveMixedSchemaData set to false. This flag never gets changed as time-series inserts through the view can never result in mixed-schema buckets. However, one can still insert mixed-schema buckets through the system.buckets collection (direct write) and we wouldn't update the flag to true. mongodump/mongorestore does this. We should check whether buckets inserted via direct writes contain mixed-schema data and set the flag appropriately.

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

              Created:
              Updated: