Timeseries view translation layer should output better error for unsupported indexes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • ALL
    • Hide

      I found this while working with the timeseries_bucket_index.js test.

      Set up:

      const coll = db.timeseries_bucket_index;
      const bucketsColl = db.getCollection('system.buckets.' + coll.getName());
      
      coll.drop();
      db.createCollection(coll.getName(), {timeseries: {timeField: 'time'}});
      
      bucketsColl.createIndex({"control.min.time": 1});
      
      const doc = {_id: 0, ['time']: new Date(), x: 0};
      coll.insertOne(doc);
      
      bucketsColl.createIndex({"control.max.time": 1});
      

      Then, list indexes on both the buckets collection (which are correct) and the user collection (which are not)

      test> db.system.buckets.timeseries_bucket_index.getIndexes()
      [
        { v: 2, key: { 'control.min.time': 1 }, name: 'control.min.time_1' },
        { v: 2, key: { 'control.max.time': 1 }, name: 'control.max.time_1' }
      ]
      
      test> db.timeseries_bucket_index.getIndexes()
      [
        { v: 2, key: { time: 1 }, name: 'control.min.time_1' },
        { v: 2, key: {}, name: 'control.max.time_1' }
      ]
      
      Show
      I found this while working with the timeseries_bucket_index.js test. Set up: const coll = db.timeseries_bucket_index; const bucketsColl = db.getCollection( 'system.buckets.' + coll.getName()); coll.drop(); db.createCollection(coll.getName(), {timeseries: {timeField: 'time' }}); bucketsColl.createIndex({ "control.min.time" : 1}); const doc = {_id: 0, [ 'time' ]: new Date(), x: 0}; coll.insertOne(doc); bucketsColl.createIndex({ "control.max.time" : 1}); Then, list indexes on both the buckets collection (which are correct) and the user collection (which are not) test> db.system.buckets.timeseries_bucket_index.getIndexes() [ { v: 2, key: { 'control.min.time' : 1 }, name: 'control.min.time_1' }, { v: 2, key: { 'control.max.time' : 1 }, name: 'control.max.time_1' } ] test> db.timeseries_bucket_index.getIndexes() [ { v: 2, key: { time: 1 }, name: 'control.min.time_1' }, { v: 2, key: {}, name: 'control.max.time_1' } ]
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Listing some kinds of indexes created on timeseries bucket collections (without using rawData) do not show up correctly when calling listIndexes on the user (non-buckets) collection. I've seen this going back to at least 7.0.

            Assignee:
            Unassigned
            Reporter:
            Michael McClimon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: