Add AwaitReplication for analyze_shard_key_options.js DSC suites

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In BF-45997, there were 5 BFGs since 8/20. The failures fall into two main categories:

      • "The shard key provided does not have
        enough cardinality to make the required number of chunks of 100,
        it can only make 51 chunks"
      • "Cannot analyze the characteristics of a
        shard key for an empty collection"

      The test setup is to insert 10000 documents into an unsharded collection (2 node RS), create an index, and then run analyzeShardKey. The second error is especially concerning, because the insert has a writeConcern of "majority", which should durably write to both nodes.

      The most likely explanation is that the writes are durable on the secondary, but are not yet fully applied when analyzeShardKey is run (which uses secondaryPreferred).

      A simple solution is to ensure the write is fully replicated to the secondary by adding a call to FixtureHelpers.awaitReplication(db), similar to analyze_shard_key_common_tests.js#L49.

            Assignee:
            Jordan Glassley
            Reporter:
            Jordan Glassley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: