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

setQuerySettings may fail on stepdown in replica sets

    • Fully Compatible
    • ALL
    • v7.0, v6.0
    • Hide

      The following command has high chances reproducing the error:

      buildscripts/resmoke.py run --suites=replica_sets_kill_primary_jscore_passthrough BF-29978.js --userFriendlyOutput=resmoke.txt --additionalFeatureFlags featureFlagQuerySettings

      ... where BF-29978.js is as follows:

      import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js";
      import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js";
      
      const coll = assertDropAndRecreateCollection(db, jsTestName());
      
      const qsutils = new QuerySettingsUtils(db, coll.getName());
      const querySettingsQuery = qsutils.makeFindQueryInstance({filter: {a: 1, b: 1}, skip: 3});
      const querySettingsSettingsA = {
          indexHints: {allowedIndexes: ["a_1"]}
      };
      const querySettingsSettingsB = {
          indexHints: {allowedIndexes: ["b_1"]}
      };
      
      for (let i = 0; i < 10000; ++i) {
          jsTest.log("Iteration = " + i);
          assert.commandWorked(
              db.adminCommand({setQuerySettings: querySettingsQuery, settings: querySettingsSettingsA}));
      
          assert.commandWorked(
              db.adminCommand({setQuerySettings: querySettingsQuery, settings: querySettingsSettingsB}));
      }
      
      Show
      The following command has high chances reproducing the error: buildscripts/resmoke.py run --suites=replica_sets_kill_primary_jscore_passthrough BF-29978.js --userFriendlyOutput=resmoke.txt --additionalFeatureFlags featureFlagQuerySettings ... where BF-29978.js is as follows: import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js" ; import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js" ; const coll = assertDropAndRecreateCollection(db, jsTestName()); const qsutils = new QuerySettingsUtils(db, coll.getName()); const querySettingsQuery = qsutils.makeFindQueryInstance({filter: {a: 1, b: 1}, skip: 3}); const querySettingsSettingsA = { indexHints: {allowedIndexes: [ "a_1" ]} }; const querySettingsSettingsB = { indexHints: {allowedIndexes: [ "b_1" ]} }; for (let i = 0; i < 10000; ++i) { jsTest.log( "Iteration = " + i); assert .commandWorked( db.adminCommand({setQuerySettings: querySettingsQuery, settings: querySettingsSettingsA})); assert .commandWorked( db.adminCommand({setQuerySettings: querySettingsQuery, settings: querySettingsSettingsB})); }
    • QE 2024-01-08, QE 2024-01-22, QE 2024-02-05
    • 19

      The setQuerySettings and removeQuerySettings may fail during a parallel step-down in replica set deployments with an unrelated error "encountered concurrent cluster parameter update operations, please try again", even when there are no commands running in parallel.

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: