Introduce raw_operation_utils.js test library

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • CAR Team 2025-04-14
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Introduce a new library to streamline the usage of raw operations.

      Raw operations are supported starting from binary version 9.0. This means that if we use raw operation in a test we will need to exclude that test from multiversion suites.

      The goal of this ticket is to create a library that allows to use raw operations in a test maintaining compatibility with multiversion suites.

      The usage of the library should look similar to

        import {getRawTimeseriesColl, kRawOperationSpec} from jstests/libs/raw_operation_utils.js;
      
        const bucketsColl = getRawTimeseriesColl(db, coll);
        let rawBucketsDocs = bucketsColl.find().rawData().toArray();
        let rawBucketsDocs = bucketsColl.aggregate([{$match: {}}], kRawOperationSpec).toArray();

      This approach ensures the code works correctly even in versions that
      do not support raw operations. Specifically:

      • In versions where raw operations are supported:
        • `getRawTimeseriesColl` acts as a no-op and simply returns the original `coll`.
        • `rawData()` and `kRawOperationSpec` effectively add the `rawData` parameter to the operation.
      • On the other hand, in versions where raw operations are not supported:
        • `getRawTimeseriesColl` returns the underlying `system.buckets` collection.
        • `rawData()` and `kRawOperationSpec` act as no-ops and do not attach any parameter to the operation.

       

            Assignee:
            Tommaso Tocci
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: