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

Sharded timeseries collections - any queries with readConcern: "available"  hang indefinitely

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 6.0.12, 7.0.5
    • None
    • Catalog and Routing
    • ALL
    • Hide

      1. Start a sharded cluster on one of the latest MongoDB releases (i.e. 7.0.5, 6.0.12 - older releases also seem to exhibit this behavior from checking a couple others)

      2. Enable sharding

      sh.enableSharding("timeseries");
      sh.shardCollection( "timeseries.weather", { "metadata.sensorId": 1 }, { timeseries: { timeField: "timestamp", metaField: "metadata", granularity: "hours" } } ); 

      3. Insert a few sample docs

       

      db.getSiblingDB("timeseries").weather.insertMany([ { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T00:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T04:00:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T08:00:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T12:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T16:00:00.000Z"), "temp": 16 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T20:00:00.000Z"), "temp": 15 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T00:00:00.000Z"), "temp": 13 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T04:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T08:00:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T12:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T16:00:00.000Z"), "temp": 17 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-19T20:00:00.000Z"), "temp": 12 }] );

      4. Attempt to query the sharded timeseries collection in some way specifying readConcern: "available" and the operation will hang indefinitely.  Any other readConcern level seems to work fine.

       

       

      db.getSiblingDB("timeseries").weather.find({"metadata.sensorId": 5578}).readConcern("available");
      db.getSiblingDB("timeseries").weather.find().readConcern("available");
      db.getSiblingDB("timeseries").weather.count({},{readConcern:"available"});

       

       

      Show
      1. Start a sharded cluster on one of the latest MongoDB releases (i.e. 7.0.5, 6.0.12 - older releases also seem to exhibit this behavior from checking a couple others) 2. Enable sharding sh.enableSharding( "timeseries" ); sh.shardCollection( "timeseries.weather" , { "metadata.sensorId" : 1 }, { timeseries: { timeField: "timestamp" , metaField: "metadata" , granularity: "hours" } } ); 3. Insert a few sample docs   db.getSiblingDB( "timeseries" ).weather.insertMany([ { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T00:00:00.000Z" ), "temp" : 12 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T04:00:00.000Z" ), "temp" : 11 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T08:00:00.000Z" ), "temp" : 11 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T12:00:00.000Z" ), "temp" : 12 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T16:00:00.000Z" ), "temp" : 16 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-18T20:00:00.000Z" ), "temp" : 15 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T00:00:00.000Z" ), "temp" : 13 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T04:00:00.000Z" ), "temp" : 12 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T08:00:00.000Z" ), "temp" : 11 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T12:00:00.000Z" ), "temp" : 12 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T16:00:00.000Z" ), "temp" : 17 }, { "metadata" : { "sensorId" : 5578 , "type" : "temperature" }, "timestamp" : ISODate( "2021-05-19T20:00:00.000Z" ), "temp" : 12 }] ); 4. Attempt to query the sharded timeseries collection in some way specifying readConcern: "available" and the operation will hang indefinitely.  Any other readConcern level seems to work fine.     db.getSiblingDB( "timeseries" ).weather.find({ "metadata.sensorId" : 5578 }).readConcern( "available" ); db.getSiblingDB( "timeseries" ).weather.find().readConcern( "available" ); db.getSiblingDB( "timeseries" ).weather.count({},{readConcern: "available" });    
    • Repl 2024-02-05, CAR Team 2024-02-19

    Description

      Any queries with readConcern: "available" will hang indefinitely on a sharded timeseries collection, while all other readConcern levels execute the same query successfully.

      Attachments

        Activity

          People

            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            shane.smith@mongodb.com Shane Smith
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated: