[SERVER-84541] setQuerySettings may fail on stepdown in replica sets Created: 03/Jan/24  Updated: 24/Jan/24  Resolved: 24/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 8.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Romans Kasperovics Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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}));
}

Sprint: QE 2024-01-08, QE 2024-01-22, QE 2024-02-05
Participants:
Linked BF Score: 4

 Description   

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.



 Comments   
Comment by Githook User [ 24/Jan/24 ]

Author:

{'name': 'romanskas', 'email': '30618745+romanskas@users.noreply.github.com', 'username': 'romanskas'}

Message: SERVER-84541 Throw on setClusterParameter update errors (#17889)

SERVER-84541 Throw on setClusterParameter update errors

This change ensures the errors from the internal collection update on
'setClusterParameter' and dependant 'setQuerySettings' and
'removeQuerySettings' commands are not ignored.

Until now, these commands may fail in stepdown passthrough suites,
because the retriable error 'PrimarySteppedDown' causing the issues was
not surfacing.

GitOrigin-RevId: f2d504ad7e1726e789399013e9e6076a285fbfec
Branch: master
https://github.com/mongodb/mongo/commit/c2233b4b3ba6807722f3b283c304fb1b2ca1b2ef

Generated at Thu Feb 08 06:55:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.