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

db.collection.stats() errors on time-series collections on a mongos

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.9 Required
    • Fix Version/s: 5.1.0, 5.0.0-rc1
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0
    • Steps To Reproduce:
      Hide

      Enterprise [direct: mongos]>    db.createCollection(
      ...        "weather25h",
      ...        {
      .....           timeseries: {
      .......              timeField: "timestamp",
      .......              metaField: "metadata",
      .......              expireAfterSeconds: 86400
      .......           }
      .....        }
      ...    )
      { ok: 1 }
      Enterprise [direct: mongos]> db.weather25h.find()
      Enterprise [direct: mongos]> db.weather25h.stats()
      MongoError: expected  to have a numeric type, but it is a missing
      Enterprise [direct: mongos]> db.weather25h.insert({})
      MongoBulkWriteError: 'timestamp' must be present an contain a valid BSON UTC datetime value
      Enterprise [direct: mongos]> db.weather25h.insert(\{timestamp: new Date()})
      {
        acknowledged: true,
        insertedIds: \{ '0': ObjectId("609ab1ae1ab8fa361309e039") }
      }
      Enterprise [direct: mongos]> db.weather25h.findOne()
      {
        timestamp: 2021-05-11T16:32:46.642Z,
        metadata: null,
        _id: ObjectId("609ab1ae1ab8fa361309e039")
      }
      Enterprise [direct: mongos]> db.weather25h.stats()
      MongoError: expected  to have a numeric type, but it is a missing
      Enterprise [direct: mongos]>
      

      Show
      Enterprise [direct: mongos]> db.createCollection( ... "weather25h", ... { ..... timeseries: { ....... timeField: "timestamp", ....... metaField: "metadata", ....... expireAfterSeconds: 86400 ....... } ..... } ... ) { ok: 1 } Enterprise [direct: mongos]> db.weather25h.find() Enterprise [direct: mongos]> db.weather25h.stats() MongoError: expected to have a numeric type, but it is a missing Enterprise [direct: mongos]> db.weather25h.insert({}) MongoBulkWriteError: 'timestamp' must be present an contain a valid BSON UTC datetime value Enterprise [direct: mongos]> db.weather25h.insert(\{timestamp: new Date()}) { acknowledged: true, insertedIds: \{ '0': ObjectId("609ab1ae1ab8fa361309e039") } } Enterprise [direct: mongos]> db.weather25h.findOne() { timestamp: 2021-05-11T16:32:46.642Z, metadata: null, _id: ObjectId("609ab1ae1ab8fa361309e039") } Enterprise [direct: mongos]> db.weather25h.stats() MongoError: expected to have a numeric type, but it is a missing Enterprise [direct: mongos]>
    • Sprint:
      Execution Team 2021-05-31

      Description

      Running this on mongodb-macos-x86_64-enterprise-4.9.0-alpha7-187-g388ce13.

      Geert Bosch says this may be because the mongos does validation on the count field which is not present for time-series collections.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              henrik.edin Henrik Edin
              Reporter:
              naomi.pentrel Naomi Pentrel
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: