Collect query stats for delete in sharded

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We have to consider multiple types of deletes in sharded clusters:

      1. Two-phase write-without-shard-key (deletes with no shard key, multi:false). Mongos broadcasts a read phase then sends a targeted _clusterWriteWithoutShardKey internal command to one shard. The shard executes the delete.
      2. Scatter-gather deletes (no shard key, multi:true). Mongos fans out to all shards. Each shard runs performDelete().
      3. Route to one shard (shard key). Mongos can extract the shard key value from the filter, compute the exact chunk it belongs to, and route to exactly one shard. This is the fast path.
      4. Direct-to-shard deletes (only with directShardOperations permissions). I don't think we expect users to do this. Clients connecting directly to a shard (bypassing mongos) with directShardOperations privilege.

       

            Assignee:
            Gil Alon
            Reporter:
            Chi-I Huang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: