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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.12, 7.0.5
    • Component/s: 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-03-18, CAR Team 2024-04-01, CAR Team 2024-04-15, CAR Team 2024-04-29, CAR Team 2024-05-13

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

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            shane.smith@mongodb.com Shane Smith
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: