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

Consider making analyzeShardKey in 8.0.1+ only run cluster aggregate command for calculating cardinality and frequency metrics with readConcern "available" if the collection is sharded

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability

      SERVER-91030 didn't make it into 8.0.0. We also can't quite backport it to 8.0.1 (see this comment). We agreed that this issue fixes (BF-30328) is very unlikely occur. However, we should consider fixing the unsharded collection case by make analyzeShardKey in 8.0.1+ only run aggregate command for calculating cardinality and frequency metrics with readConcern "available" if the collection is sharded. For an unsharded collection, using readConcern "available" could lead to the
      "Cannot analyze the cardinality and frequency of a shard key because the number of sampled documents is zero" error if there are two moveCollection commands between step (1) and step (4) described in the comment linked above, where the first one moves the collection from the shard running the analyzeShardKey command to some shardA before step (3), and the other moves the collection from shardA to shardB between step (3) and (4). 

            Assignee:
            Unassigned Unassigned
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: