[DRIVERS-2243] Inherited comment causes OperationFailure on MongoDB <4.4.0 Created: 22/Mar/22  Updated: 09/Aug/22  Resolved: 09/Aug/22

Status: Closed
Project: Drivers
Component/s: CRUD
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Julius Park (Inactive) Assignee: Dmitry Rybakov
Resolution: Done Votes: 0
Labels: size-small, spec-change
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DRIVERS-2300 runCommand for `getMore` does not sup... Closed
Issue split
split to CSHARP-4108 Inherited comment causes OperationFai... Closed
split to CXX-2475 Inherited comment causes OperationFai... Closed
split to GODRIVER-2357 Inherited comment causes OperationFai... Closed
split to MOTOR-917 Inherited comment causes OperationFai... Closed
split to NODE-4115 Inherited comment causes OperationFai... Closed
split to PYTHON-3181 Inherited comment causes OperationFai... Closed
split to RUBY-2933 Inherited comment causes OperationFai... Closed
split to RUST-1233 Inherited comment causes OperationFai... Closed
split to PHPLIB-749 Support comment option on command hel... Closed
split to CDRIVER-4199 Add support for the comment field to ... Closed
split to JAVA-4547 Inherited comment causes OperationFai... Closed
Problem/Incident
is caused by DRIVERS-2189 getMore helper should explicitly send... Closed
Related
related to DRIVERS-2214 Fix getMore with comment specs Closed
related to DRIVERS-742 Add support for the comment field to ... Closed
Driver Changes: Needed
Downstream Changes Summary:

Drivers should sync change-streams, aggregate, and find-comment spec tests from mongodb/specifications@97c54e2.

Driver Compliance:
Key Status/Resolution FixVersion
CXX-2475 Fixed 3.7.0
CSHARP-4108 Fixed 2.15.1
GODRIVER-2357 Duplicate
JAVA-4547 Fixed 4.6.0
NODE-4115 Fixed 4.5.0
MOTOR-917 Duplicate
PYTHON-3181 Duplicate
RUBY-2933 Fixed 2.18.0
RUST-1233 Duplicate
SWIFT-1530 Duplicate
PHPLIB-749 Fixed 1.13.0-beta1, 1.13.0
CDRIVER-4199 Fixed 1.22.0, 1.22.0-beta0

 Description   

While implementing DRIVERS-2189 for the Python Driver (PYTHON-3119) I found a bug caused by the fact that "comment" is not supported for getMore commands on MongoDB <4.4.0. The issue is that for find/agg commands "comment" has been supported at the top level since before 4.4.0, but when the driver then inherits those comments to the getMore, the user will experience an OperationFailure when using MongoDB <4.4.0.



 Comments   
Comment by Githook User [ 27/Mar/22 ]

Author:

{'name': 'Dmitry Rybakov', 'email': 'dmitry.rybakov@mongodb.com', 'username': 'comandeo'}

Message: Fix getMore with comment specs (#1161)

Comment by Julius Park (Inactive) [ 23/Mar/22 ]

Tested this locally and it appears that 4.4.0 works fine, however 4.2.10 causes the same OperationFailure:

pymongo.errors.OperationFailure: Failed to parse: { getMore: 8394229009355055096, collection: "test", batchSize: 2, comment: "this is a test", lsid: { id: UUID("5826c188-57da-404d-8084-24813051c1d0") }, $db: "pymongo_test" }. Unrecognized field 'comment'., full error: {'ok': 0.0, 'errmsg': 'Failed to parse: { getMore: 8394229009355055096, collection: "test", batchSize: 2, comment: "this is a test", lsid: { id: UUID("5826c188-57da-404d-8084-24813051c1d0") }, $db: "pymongo_test" }. Unrecognized field \'comment\'.', 'code': 9, 'codeName': 'FailedToParse'}

Amending title and description to reflect that fact.

Comment by Shane Harvey [ 23/Mar/22 ]

Are you sure it’s 4.4.4 and not 4.4.0? If it's 4.4.0, then what if we say that drivers only send comment on getMore when the server is >=4.4 (using maxWireVersion)?

Comment by Jeffrey Yemin [ 23/Mar/22 ]

Seems like the fix for DRIVERS-2214 hides the issue by restricting the getMore test to run on 4.4+.

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