• Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      These commands are normally executed in two phases - ClusterQueryWithoutShardKey - we issue a find on all shards to find the document, merge and sort the results, and delete the first document from the front of the sorted list.

      For explain however, the logic is slightly different. We run explain() on the ClusterQueryWithoutShardKey. This does not return the documents themselves. It sneaks a targetShardId into the explain BSON (cluster_query_without_shard_key_cmd.cpp), which is later used to issue a delete() explain against that one shard (cluster_write_cmd.cpp).

      The real execution path sorts the documents to decide which documents to delete from. The explain path picks a targetShardId arbitrarily on which to run the explain for the write portion. In this case, the shard contained no matches for that predicate, and therefore, the delete explain can "randomly" report a shard which does not contain matching documents and unexpected explain stats.

            Assignee:
            Unassigned
            Reporter:
            Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: