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

Sparse .hint() Functionality is Different in MMAPv1 vs. WiredTiger

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0-rc6
    • Labels:
      None
    • ALL
    • Hide
      • Note: I did this with mlaunch v 1.1.7
      • First, download the attached tarball and go to the directory you saved it to.
        $ tar xvf mlaunch_data_failed_sparse_hint.tar.gz
        $ mlaunch start
        $ mongo
        mongos> db.foo.explain("executionStats").find( { a : 12, b : 25, c : 8 } ).hint( { e : 1 } )
        
      • Expected result:
        • The query is executed, but misses a document that lacks an "e" field (and therefore an index entry on { e : 1 }
      • Actual result:
        • An error is thrown:
          2015-01-27T10:35:27.605-0500 E QUERY    Error: explain failed: {
          	"ok" : 0,
          	"errmsg" : "Explain command on shard cross-mb-air.local:27018 failed, caused by: { ok: 0.0, errmsg: \"error processing query: ns=test.foo limit=0 skip=0\nTree: $and\n    a == 12.0\n    b == 25.0\n    c == 8.0\nSort: {}\nProj: {}\n planner returned error: bad hint\", code: 2, $gleStats: { lastOpTime: Timestamp 0|0, electionId: ObjectId('54c7aef96a0ab41446ee1188') } }",
          	"code" : 2
          }
              at Error (<anonymous>)
              at Function.throwOrReturn (src/mongo/shell/explainable.js:34:19)
              at constructor.finish (src/mongo/shell/explain_query.js:188:36)
              at constructor.shellPrint (src/mongo/shell/explain_query.js:228:31)
              at shellPrintHelper (src/mongo/shell/utils.js:396:18)
              at (shell2):1:19 at src/mongo/shell/explainable.js:34
          
      Show
      Note: I did this with mlaunch v 1.1.7 First, download the attached tarball and go to the directory you saved it to. $ tar xvf mlaunch_data_failed_sparse_hint.tar.gz $ mlaunch start $ mongo mongos> db.foo.explain( "executionStats" ).find( { a : 12, b : 25, c : 8 } ).hint( { e : 1 } ) Expected result: The query is executed, but misses a document that lacks an "e" field (and therefore an index entry on { e : 1 } Actual result: An error is thrown: 2015-01-27T10:35:27.605-0500 E QUERY Error: explain failed: { "ok" : 0, "errmsg" : "Explain command on shard cross-mb-air.local:27018 failed, caused by: { ok: 0.0, errmsg: \" error processing query: ns=test.foo limit=0 skip=0\nTree: $and\n a == 12.0\n b == 25.0\n c == 8.0\nSort: {}\nProj: {}\n planner returned error: bad hint\ ", code: 2, $gleStats: { lastOpTime: Timestamp 0|0, electionId: ObjectId( '54c7aef96a0ab41446ee1188' ) } }" , "code" : 2 } at Error (<anonymous>) at Function.throwOrReturn (src/mongo/shell/explainable.js:34:19) at constructor.finish (src/mongo/shell/explain_query.js:188:36) at constructor.shellPrint (src/mongo/shell/explain_query.js:228:31) at shellPrintHelper (src/mongo/shell/utils.js:396:18) at (shell2):1:19 at src/mongo/shell/explainable.js:34

      WiredTiger throws an error when I hint() on a sparse index. This is a problem because it should conform to the behavior of MMAPv1, which is to use the index but skip any documents that lack an entry on that index.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            william.cross William Cross
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: