Simplify $out stage by removing unnecessary stripping of clusteredIndex/validator fields

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • CAR Team 2026-07-06, CAR Team 2026-07-20, CAR Team 2026-08-03
    • 1
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      In OutStage::createTemporaryCollection(), when creating the temporary collection for $out to a timeseries target, the code strips the "clusteredIndex" and "validator" fields from the original collection options obtained via listCollections. This was needed because passing those fields alongside the "timeseries" field to the create command was invalid.

      However, SERVER-105339 already fixed listCollections to not return "clusteredIndex" and "validator" for viewless timeseries collections, and SERVER-56933 established the principle that listCollections output should be directly usable to recreate collections. Therefore the removeFields workaround should no longer be necessary and the code can be simplified.

      The fix should:

      1. Remove the {{removeFields( {"clusteredIndex", "validator"}

        )}} call

      1. Verify that listCollections already excludes these fields for all timeseries collection types
      2. Add test coverage to ensure $out to timeseries works without the stripping logic

      Note: Currently, not every path of $out utilises the listCollections command. Therefore, this ticket should be done after SERVER-123282. Moreover, $out + listCollections could incorrectly handle legacy timeseries targets during an FCV upgrade, due to a race between legacy to viewless timeseries conversion (triggered by the upgrade) and $out execution. Hence, this ticket should only proceed when 9.0 becomes the last LTS.

            Assignee:
            [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: