[SERVER-65954] Sharded clusters v4.2, 4.0, and 3.6 do not raise error if a comment is sent with count command Created: 26/Apr/22  Updated: 06/Dec/22

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

Type: Bug Priority: Minor - P4
Reporter: Dmitry Rybakov Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-63315 Count command only accepts a string c... Closed
Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

Connect to a sharded cluster v 3.6 - 4.2, and execute count command with comment:

mongos> db.version()
4.0.8
mongos> db.runCommand({count: 'users', comment: {message: 'hello'}})
{
	"shards" : {
		
	},
	"n" : 0,
	"ok" : 1,
	"operationTime" : Timestamp(1650975508, 1),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1650975508, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
}

When same command is executed on standalone:

> db.version()
4.0.8
> db.runCommand({count: 'users', comment: {message: 'hello'}})
{
	"ok" : 0,
	"errmsg" : "comment value is not a string",
	"code" : 2,
	"codeName" : "BadValue"
}

Participants:

 Description   

Count command docs states that count command supports a comment from version 4.4. Older server versions raise an error when receive count command with a comment. However, if cluster is in a sharded topology, no error is raised.

Expected behavior is that server raises an error in all topologies.



 Comments   
Comment by Edwin Zhou [ 10/May/22 ]

I may have preemptively closed this after misunderstanding the issue. It looks like the error message isn't properly bubbling up to the mongos layer.

I'll assign this to the Sharding team to investigate why we're not seeing this error message on the router.

Comment by Edwin Zhou [ 10/May/22 ]

dmitry.rybakov@mongodb.com, it looks like this issue duplicates SERVER-63315, which was fixed in 4.4.14.

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