Test failure in array_index_and_nonIndex_consistent.js due to shard order dependency

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As part of the task https://jira.mongodb.org/browse/SERVER-112726 the random balancing was enabled in buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough_with_config_transitions_and_add_remove_shard.yml suite.
      With this new configuration array_index_and_nonIndex_consistent.js started to fail.

      New configuration:

      fixture:  
        class: ShardedClusterFixture  
        enable_balancer: true  
        random_migrations: true  
      

      The test uses isIxscanMultikey() helper function from jstests/libs/query/analyze_plan.js, which calls getPlanStage() to retrieve plan stage information. However, getPlanStage() only returns the plan stage from the first shard in the indexPlan array.

      When the ContinuousAddRemoveShard hook adds a new shard:

      • The new shard (e.g., shard-rs1_1) is added to replace an old one
      • This new shard generates a query plan with:
      "isMultiKey" : false,  
      "multiKeyPaths" : {  
          "val" : [ ]  
      }  
      
      • Initially, if this shard appears at the end of the shard list, the test passes because getPlanStage() reads from the first (existing) shard
      • After the balancer performs random migrations, the new shard can be reordered to the top of the shard list
      • When this happens, getPlanStage() now returns the plan from the new shard (with isMultiKey: false), causing assertion failures

      The test makes an incorrect assumption that checking only the first shard's plan is sufficient in a sharded environment with dynamic shard topology changes.

            Assignee:
            Unassigned
            Reporter:
            Igor Praznik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: