Resharding validation aggregation shouldn't hint the _id index

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      To count the number of documents that need to be copied to the resharded collection, resharding validation added a $count aggregation that runs on each donor shard at the clone timestamp. The aggregation uses a hint on the _id index and the idea was this lets it be covered by that index, so we can generate a count without actually reading every document into memory. Unfortunately, if the collection is sharded, it can't be covered by an index scan unless that index includes the full shard key because the possibility of orphans requires a shard filter stage, which must fetch the full document for a non-shard key index, which is essentially random IO.

      Instead, we should use a hint with the shard key index so the query is covered.

            Assignee:
            Unassigned
            Reporter:
            Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: