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

"No query solutions" WriteConcernException on simple delete query with index

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.9
    • Component/s: Index Maintenance
    • None
    • ALL
    • Hide

      It does not happen in all sharded collections. So i dont think this is reproducible.

      Although i can reproduce it consistently on this collection.

      Show
      It does not happen in all sharded collections. So i dont think this is reproducible. Although i can reproduce it consistently on this collection.

      I have a sharded collection with 5 repsets consisting of 3 mongod instances respectively. On the shards I have a collection sharded by

      { t: hashed}

      .

      I enabled the no-table-scan parameter via db query to all mongod instances.
      A while after that, delete and findAndModify queries showed up with no query solution.
      The weird situation is that the queries should have a solution since indices for it are present.

      There are these indices on the collection on all mongod instances:

      [
          {
              "v" : 1,
              "key" : {
                  "t" : "hashed"
              },
              "name" : "t_hashed",
          },
          {
              "v" : 1,
              "unique" : true,
              "key" : {
                  "t" : 1,
                  "ty" : 1,
                  "s" : 1
              },
              "name" : "t_1_ty_1_s_1",
              "background" : true
          },
          {
              "v" : 1,
              "key" : {
                  "s" : 1,
                  "ty" : 1
              },
              "name" : "s_1_ty_1",
              "background" : true
          },
          {
              "v" : 1,
              "key" : {
                  "_id" : 1
              },
              "name" : "_id_",
          }
      ]
      

      When I query with: db.getCollection('x').find(

      {s : 327079355}

      )
      I get an answer (although empty).
      if I do a remove query: db.getCollection('x').remove(

      {s : 327079355}

      )
      I get:

      multiple errors for op : error processing query: ns=dbname.x: s == 327079355.0
      Sort: {}
      Proj: {}
       No query solutions :: and :: error processing query: ns=dbname.xTree: s == 327079355.0
      Sort: {}
      Proj: {}
       No query solutions ...
      

      i also did a short test and created a document and used that in the delete query.
      Weirdly the remove query deleted the document but returned the error above too.
       
      The output of db.getCollection('x').find(

      {s : 327079355}

      ).explain():

      /* 1 */
      {
          "queryPlanner" : {
              "mongosPlannerVersion" : 1,
              "winningPlan" : {
                  "stage" : "SHARD_MERGE",
                  "shards" : [ 
                      {
                          "shardName" : "repset11",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "FETCH",
                              "inputStage" : {
                                  "stage" : "IXSCAN",
                                  "keyPattern" : {
                                      "s" : 1,
                                      "ty" : 1
                                  },
                                  "indexName" : "s_1_ty_1",
                                  "isMultiKey" : false,
                                  "multiKeyPaths" : {
                                      "s" : [],
                                      "ty" : []
                                  },
                                  "isUnique" : false,
                                  "isSparse" : false,
                                  "isPartial" : false,
                                  "indexVersion" : 1,
                                  "direction" : "forward",
                                  "indexBounds" : {
                                      "s" : [ 
                                          "[327079355.0, 327079355.0]"
                                      ],
                                      "ty" : [ 
                                          "[MinKey, MaxKey]"
                                      ]
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset12",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "FETCH",
                              "inputStage" : {
                                  "stage" : "IXSCAN",
                                  "keyPattern" : {
                                      "s" : 1,
                                      "ty" : 1
                                  },
                                  "indexName" : "s_1_ty_1",
                                  "isMultiKey" : false,
                                  "multiKeyPaths" : {
                                      "s" : [],
                                      "ty" : []
                                  },
                                  "isUnique" : false,
                                  "isSparse" : false,
                                  "isPartial" : false,
                                  "indexVersion" : 1,
                                  "direction" : "forward",
                                  "indexBounds" : {
                                      "s" : [ 
                                          "[327079355.0, 327079355.0]"
                                      ],
                                      "ty" : [ 
                                          "[MinKey, MaxKey]"
                                      ]
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset13",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "FETCH",
                              "inputStage" : {
                                  "stage" : "IXSCAN",
                                  "keyPattern" : {
                                      "s" : 1,
                                      "ty" : 1
                                  },
                                  "indexName" : "s_1_ty_1",
                                  "isMultiKey" : false,
                                  "multiKeyPaths" : {
                                      "s" : [],
                                      "ty" : []
                                  },
                                  "isUnique" : false,
                                  "isSparse" : false,
                                  "isPartial" : false,
                                  "indexVersion" : 1,
                                  "direction" : "forward",
                                  "indexBounds" : {
                                      "s" : [ 
                                          "[327079355.0, 327079355.0]"
                                      ],
                                      "ty" : [ 
                                          "[MinKey, MaxKey]"
                                      ]
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset14",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "FETCH",
                              "inputStage" : {
                                  "stage" : "IXSCAN",
                                  "keyPattern" : {
                                      "s" : 1,
                                      "ty" : 1
                                  },
                                  "indexName" : "s_1_ty_1",
                                  "isMultiKey" : false,
                                  "multiKeyPaths" : {
                                      "s" : [],
                                      "ty" : []
                                  },
                                  "isUnique" : false,
                                  "isSparse" : false,
                                  "isPartial" : false,
                                  "indexVersion" : 1,
                                  "direction" : "forward",
                                  "indexBounds" : {
                                      "s" : [ 
                                          "[327079355.0, 327079355.0]"
                                      ],
                                      "ty" : [ 
                                          "[MinKey, MaxKey]"
                                      ]
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset17",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "FETCH",
                              "inputStage" : {
                                  "stage" : "IXSCAN",
                                  "keyPattern" : {
                                      "s" : 1,
                                      "ty" : 1
                                  },
                                  "indexName" : "s_1_ty_1",
                                  "isMultiKey" : false,
                                  "multiKeyPaths" : {
                                      "s" : [],
                                      "ty" : []
                                  },
                                  "isUnique" : false,
                                  "isSparse" : false,
                                  "isPartial" : false,
                                  "indexVersion" : 1,
                                  "direction" : "forward",
                                  "indexBounds" : {
                                      "s" : [ 
                                          "[327079355.0, 327079355.0]"
                                      ],
                                      "ty" : [ 
                                          "[MinKey, MaxKey]"
                                      ]
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }
                  ]
              }
          },
          "ok" : 1.0
      }
      

      The output of db.getCollection('x').explain().remove(

      {s : 327079355}

      ):

      /* 1 */
      {
          "queryPlanner" : {
              "mongosPlannerVersion" : 1,
              "winningPlan" : {
                  "stage" : "SHARD_WRITE",
                  "shards" : [ 
                      {
                          "shardName" : "repset11",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "DELETE",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "s" : 1,
                                          "ty" : 1
                                      },
                                      "indexName" : "s_1_ty_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "s" : [],
                                          "ty" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "s" : [ 
                                              "[327079355.0, 327079355.0]"
                                          ],
                                          "ty" : [ 
                                              "[MinKey, MaxKey]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset12",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "DELETE",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "s" : 1,
                                          "ty" : 1
                                      },
                                      "indexName" : "s_1_ty_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "s" : [],
                                          "ty" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "s" : [ 
                                              "[327079355.0, 327079355.0]"
                                          ],
                                          "ty" : [ 
                                              "[MinKey, MaxKey]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset13",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "DELETE",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "s" : 1,
                                          "ty" : 1
                                      },
                                      "indexName" : "s_1_ty_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "s" : [],
                                          "ty" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "s" : [ 
                                              "[327079355.0, 327079355.0]"
                                          ],
                                          "ty" : [ 
                                              "[MinKey, MaxKey]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset14",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "DELETE",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "s" : 1,
                                          "ty" : 1
                                      },
                                      "indexName" : "s_1_ty_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "s" : [],
                                          "ty" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "s" : [ 
                                              "[327079355.0, 327079355.0]"
                                          ],
                                          "ty" : [ 
                                              "[MinKey, MaxKey]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }, 
                      {
                          "shardName" : "repset17",
                          "serverInfo" : {
                              "version" : "3.4.9",
                              "gitVersion" : "876ebee8c7dd0e2d992f36a848ff4dc50ee6603e"
                          },
                          "plannerVersion" : 1,
                          "namespace" : "dbname.x",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "s" : {
                                  "$eq" : 327079355.0
                              }
                          },
                          "winningPlan" : {
                              "stage" : "DELETE",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "s" : 1,
                                          "ty" : 1
                                      },
                                      "indexName" : "s_1_ty_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "s" : [],
                                          "ty" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "s" : [ 
                                              "[327079355.0, 327079355.0]"
                                          ],
                                          "ty" : [ 
                                              "[MinKey, MaxKey]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }
                  ]
              }
          },
          "ok" : 1.0
      }
      

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            breitlauch Daniel Breitlauch
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: