[SERVER-60112] Audit server commands for accepted numeric types and accept int32 where necessary Created: 21/Sep/21  Updated: 29/Oct/23  Resolved: 09/Feb/22

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

Type: Task Priority: Major - P3
Reporter: Anna Henningsen Assignee: Jordi Olivares Provencio
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to MONGOSH-967 Cannot resize oplog via mongosh Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-02-21
Participants:

 Description   

Some server commands (e.g. replSetResizeOplog) expect a subset of their parameters to be of BSON type double, and reject other numeric types.

This worked well for the legacy shell, which sent its numeric values as double by default. However, in mongosh we intentionally decided to use the Node.js driver’s behavior, which diverges and passes numbers that can be represented as BSON int32}}s as such. For example, {{db.adminCommand({ replSetResizeOplog: 1, size: 990 }) is rejected by current server versions when sent from mongosh.

Ideally, the server should accept other numeric types in the places where it expects a double, or at least int32 as an alternative.



 Comments   
Comment by Githook User [ 09/Feb/22 ]

Author:

{'name': 'Jordi Olivares Provencio', 'email': 'jordi@jolivar.es', 'username': 'jordiolivares'}

Message: SERVER-60112 Relax argument types of profile and replSetResizeOplog
Branch: master
https://github.com/mongodb/mongo/commit/28cffc2d258c969faacb968275cddf9cc26a7649

Comment by Alex Bevilacqua [ 23/Sep/21 ]

Doing a quick check via

ag -G'\.idl$' --ignore '*test*' " type: double"

it looks like there are only two commands:

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