"Mixed schema" error while attempting to delete docs from a time series bucket

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.0.4
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Hide

      Use attached script or:

      1. Create a new time series collection:
        1. timeField: `"Shrine"`
        2. metaField: `"Delta"`
        3. granularity: `"seconds"`
      2. Insert docs from anonymized.json.
      3. (All 10 docs get added to the same bucket.)
      4. Attempt to delete docs one by one.
      5. Deletion will fail ("mixed schema" error).
      6. Delete the 7th doc.
      7. Deletion succeeds.
      8. You can then delete all other docs successfully.
      Show
      Use attached script or: Create a new time series collection: timeField: `"Shrine"` metaField: `"Delta"` granularity: `"seconds"` Insert docs from anonymized.json. (All 10 docs get added to the same bucket.) Attempt to delete docs one by one. Deletion will fail ("mixed schema" error). Delete the 7th doc. Deletion succeeds. You can then delete all other docs successfully.
    • Storage Execution 2025-07-07
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      [This is on a non-sharded 8.0 replica set]

      We store fairly large, schema-less data structures in time series collections. A job runs once an hour that deletes docs older than X time. Several times a day, we receive a "mixed schema" error when the job attempts to delete certain docs from a time series bucket:

      Cannot write time-series bucket containing mixed schema data, please run collMod with timeseriesBucketsMayHaveMixedSchemaData and retry your update 

      We isolated our investigation to a single bucket to see if we could reproduce the error and find its source. The bucket contained 10 documents, and we discovered that theĀ seventh doc was causing the problem: `Jungle.Anvil.Quiet.Wheat` (in the attached anonymized data) was an array of `null` values, while in the other docs that contained `Jungle.Anvil.Quiet.Wheat`, it was an array of numbers. We tested by changing the `null` values to numbers and found that we were able to delete any docs in the bucket successfully.

        1. anonymized.json
          1.48 MB
        2. time_series_error_repro.sh
          5 kB

            Assignee:
            Binh Vo
            Reporter:
            Katie Peters
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: