Tailable cursors do not honor $maxScan values

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.0, 2.6.1-rc0
    • Component/s: Querying
    • None
    • ALL
    • Hide
      db.createCollection("tailable", {size: 1000000, capped: true});
      
      for (var i = 0; i < 10000; i++) {
          db.tailable.insert({i: i});
      }
      
      db.tailable.find().addOption(DBQuery.Option.tailable)._addSpecial("$maxScan", 100).explain();
      
      Show
      db.createCollection("tailable", {size: 1000000, capped: true}); for (var i = 0; i < 10000; i++) { db.tailable.insert({i: i}); } db.tailable.find().addOption(DBQuery.Option.tailable)._addSpecial("$maxScan", 100).explain();
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In 2.4.10, tailable cursors seem to honor $maxScan values:

      > db.tailable.find().addOption(DBQuery.Option.tailable)._addSpecial("$maxScan", 100).explain();
      {
      	"cursor" : "ForwardCappedCursor",
      	"isMultiKey" : false,
      	"n" : 100,
      	"nscannedObjects" : 100,
      	"nscanned" : 101,
      	"nscannedObjectsAllPlans" : 100,
      	"nscannedAllPlans" : 101,
      ...
      

      In 2.6 and 2.6.1-rc0, they do not:

      > db.tailable.find().addOption(DBQuery.Option.tailable)._addSpecial("$maxScan", 100).explain();
      {
      	"cursor" : "BasicCursor",
      	"isMultiKey" : false,
      	"n" : 10000,
      	"nscannedObjects" : 10000,
      	"nscanned" : 10000,
      	"nscannedObjectsAllPlans" : 10000,
      	"nscannedAllPlans" : 10000,
      ...
      

            Assignee:
            Unassigned
            Reporter:
            Kamran K. (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: