[SERVER-71283] Check if the cluster is sharded before running _shardsvrReshardingOperationTime Created: 11/Nov/22  Updated: 29/Oct/23  Resolved: 15/Nov/22

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

Type: Bug Priority: Major - P3
Reporter: Nandini Bhartiya Assignee: Nandini Bhartiya
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1
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:
v6.1, v6.0, v5.0
Steps To Reproduce:

diff --git a/jstests/replsets/test1.js b/jstests/replsets/test1.js
new file mode 100644
index 00000000000..49c572640a1
— /dev/null
+++ b/jstests/replsets/test1.js
@@ -0,0 +1,21 @@
+// Tests the _shardsvrReshardingOperationTime command against an unsharded cluster
+
+load("jstests/replsets/rslib.js");
+load('jstests/replsets/libs/election_metrics.js');
+load("jstests/libs/write_concern_util.js");
+
+(function() {
+"use strict";
+var name = "stepup";
+var rst = new ReplSetTest(
 
{name: name, nodes: 2}
 
);
+
+rst.startSet();
+rst.initiate();
+
+var primary = rst.getPrimary();
+var db = primary.getDB('test');
+assert.commandWorked(db.adminCommand({'{_}shardsvrReshardingOperationTime': '_id{_}'}));
+rst.stopSet();
+})();

Sprint: Sharding NYC 2022-11-28
Participants:
Linked BF Score: 35
Story Points: 2

 Description   

The _shardsvrReshardingOperationTime command should only be run against a sharded cluster. This check is not in place and causes the server to crash if the command is run against an unsharded cluster



 Comments   
Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}

Message: SERVER-71283: Ensure cluster is sharded before running _shardsvrReshardingOperationTime
Branch: master
https://github.com/mongodb/mongo/commit/e303ed75584081b10b8221d5c09cae5c921d16b6

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