$out commit in replica set concurrent to viewless timeseries FCV upgrade may return NamespaceExists error

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: 9.0.0-rc0, 9.1.0-rc0
    • Component/s: Query Execution
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v9.0
    • CAR Team 2026-08-17
    • 0
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      Bug: The following interleaving of $out with viewless timeseries FCV upgrade incorrectly returns a NamespaceExists error to the user:

      1. Cluster is on FCV 8.0 (viewful timeseries).
      2. The user runs a timeseries $out where the output collection "coll":
        • Already exists as a timeseries collection.
        • Has non default options (e.g. options:{timeseries: {...},expiresAfterSeconds: 3600}.
      3. The timeseries $out starts commit and overwrites the output "system.buckets.coll".
      4. Right after, "system.buckets.coll" is upgraded to viewless format by a FCV upgrade.
      5. The timeseries $out commit continues and tries to create the timeseries view; this ONLY passes the timeseries options but not the non default options.
      6. Therefore, it hits a NamespaceExists error because the non-default options (e.g. expiresAfterSeconds) don't match and falls into the _handleTimeseriesCreateError handler.
      7. This handler then checks if the timeseries options still match and if they do it ignores the error.
      8. However the code only considers the viewful timeseries case, missing that a viewless timeseries collection with the expected timeseries options already exists.

       

      CommonMongodProcessInterface::_getTimeseriesOptions should consider viewless timeseries as well.

      This bug is only for replica sets because the sharded override already considers both.

            Assignee:
            Joan Bruguera Micó
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: