Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58130

Changing time-series collection validator is acknowledged by server without errors

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Backport Requested:
      v5.0
    • Steps To Reproduce:
      Hide

      With a mongosh connect to a server that supports timeseries collections and run something similar to the following commands (output provided for context):

      > db.createCollection("timeseries_123", { timeseries: { timeField: "a" } });
      { ok: 1 }
      > // expecting the next command to return an Error
      > db.runCommand({ collMod: "timeseries_123", validator: { required: ["a"] } });
      { ok: 1 }
      > // this one just confirms that validator is not actually set which is expected
      > db.getCollectionInfos().find(coll => coll.name === 'timeseries_123')
      {
        name: 'timeseries_123',
        type: 'timeseries',
        options: {
          timeseries: {
            timeField: 'a',
            granularity: 'seconds',
            bucketMaxSpanSeconds: 3600
          }
        },
        info: { readOnly: false }
      }
      

      Show
      With a mongosh connect to a server that supports timeseries collections and run something similar to the following commands (output provided for context): > db.createCollection("timeseries_123", { timeseries: { timeField: "a" } }); { ok: 1 } > // expecting the next command to return an Error > db.runCommand({ collMod: "timeseries_123", validator: { required: ["a"] } }); { ok: 1 } > // this one just confirms that validator is not actually set which is expected > db.getCollectionInfos().find(coll => coll.name === 'timeseries_123') { name: 'timeseries_123', type: 'timeseries', options: { timeseries: { timeField: 'a', granularity: 'seconds', bucketMaxSpanSeconds: 3600 } }, info: { readOnly: false } }
    • Sprint:
      Execution Team 2021-09-20, Execution Team 2021-10-04

      Description

      Trying to change time-series collection validator with collMod command currently returns ok: 1 even though the change doesn't seem to be applied. An expected behavior would be to get an error similar to the view collection, something like "option not supported on a time-series collection: validator"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yuhong.zhang Yuhong Zhang
              Reporter:
              sergey.petushkov Sergey Petushkov
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: