[SERVER-57540] IDL accepts 'null' CommitQuorum type Created: 08/Jun/21  Updated: 29/Oct/23  Resolved: 23/Jun/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc4, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: post-rc0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Steps To Reproduce:

noPassthrough reproducer:

(function() {
"use strict";
const st = ShardingTest({shards: 1});
const mongos = st.s0;
 
var testDB = mongos.getDB('TopChunkDB')
assert.commandWorked(testDB.createCollection("twoPhaseIndexBuild"));
 
testDB.runCommand({
    setIndexCommitQuorum: 'twoPhaseIndexBuild',
    indexNames: ['a_1'],
    commitQuorum: null,
});
 
st.stop();
}());

Sprint: Security 2021-06-28
Participants:
Linked BF Score: 135

 Description   

There's a build failure where we run setIndexCommitQuorum with the following arguments:

(gdb) p _opMsgRequest
$2 = {
  <mongo::OpMsg> = {
    body = owned BSONObj 214 bytes @ 0x7f8c0925ccbd = {
      [setIndexCommitQuorum] = "twoPhaseIndexBuild",
      [indexNames] = ["a_1"],
      [commitQuorum] = null,
      [$clusterTime] = {"clusterTime": {"$timestamp": {"t": 1623174548, "i": 15}}, "signature": {"hash": {"$binary": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "$type": "00"}, "keyId": 0}},
      [$db] = "TopChunkDB"
    }, 
    sequences = std::vector of length 0, capacity 0
  }, <No data fields>}

The 'null' type isn't one of the acceptable values for CommitQuorum. See: https://github.com/mongodb/mongo/blob/f1370eb80c66f1439bc2ea135a2bf25e80eda1ed/src/mongo/db/catalog/commit_quorum.idl#L38-L42

mark.benvenuto discovered a bug in the non-strict IDL parser that seems to be the cause of this.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 23/Jun/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-57540 IDL accepts null CommitQuorum type

(cherry picked from commit 3be5fb13dfd534fbb91cb93a45c350d7dd58d70c)
Branch: v5.0
https://github.com/mongodb/mongo/commit/651361eec8e4ee468c33e21dd6f346bf141868b3

Comment by Githook User [ 23/Jun/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-57540 IDL accepts null CommitQuorum type
Branch: master
https://github.com/mongodb/mongo/commit/3be5fb13dfd534fbb91cb93a45c350d7dd58d70c

Generated at Thu Feb 08 05:42:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.