[DRIVERS-2290] No error raised for bulkWrite with comment on <= 3.2 Created: 22/Apr/22  Updated: 17/Jun/22  Resolved: 17/Jun/22

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

Type: Spec Change Priority: Major - P3
Reporter: Preston Vasquez Assignee: Preston Vasquez
Resolution: Done Votes: 0
Labels: yaml-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-2199 Add support for the comment field to ... Closed
Issue split
split to PHPLIB-749 Support comment option on command hel... Closed
split to CSHARP-4151 No error raised for bulkWrite with co... Closed
split to CXX-2498 No error raised for bulkWrite with co... Closed
split to GODRIVER-2394 No error raised for bulkWrite with co... Closed
split to MOTOR-947 No error raised for bulkWrite with co... Closed
split to NODE-4207 No error raised for bulkWrite with co... Closed
split to PYTHON-3238 No error raised for bulkWrite with co... Closed
split to RUBY-2970 No error raised for bulkWrite with co... Closed
split to RUST-1291 No error raised for bulkWrite with co... Closed
split to CDRIVER-4199 Add support for the comment field to ... Closed
split to JAVA-4591 No error raised for bulkWrite with co... Closed
Problem/Incident
is caused by DRIVERS-742 Add support for the comment field to ... Closed
Driver Changes: Needed
Downstream Changes Summary:

Drivers should sync unified crud spec tests to mongodb/specifications@b8371ea.

Driver Compliance:
Key Status/Resolution FixVersion
CXX-2498 Fixed 3.7.0
CSHARP-4151 Won't Do
GODRIVER-2394 Duplicate
JAVA-4591 Fixed 4.7.0
NODE-4207 Works as Designed
MOTOR-947 Duplicate
PYTHON-3238 Won't Do
RUBY-2970 Won't Do
RUST-1291 Duplicate
SWIFT-1554 Duplicate
CDRIVER-4199 Fixed 1.22.0, 1.22.0-beta0
PHPLIB-749 Fixed 1.13.0-beta1, 1.13.0

 Description   

No Error on RunCommand comment for (version <= 3.2)

BulkWrite doesn't appear to error on versions <= 3.2 if a comment is included in the run command:

> db.runCommand({ delete: "records", deletes: [], comment: "x" })
{ "ok" : 1, "n" : 0 }

However, version=3.6 does result in an error:

Enterprise test> db.runCommand({ delete: "records", deletes: [], comment: "x" })
MongoServerError: BSON field 'delete.comment' is an unknown field.

 

Original Description

The DBX-GO team is running into two errors when trying to implement GODRIVER-2199, which was split from DRIVER-742 .

No error on Aggregation (3.6 <= version <= 4.2)

The aggregate.json spec test expects an error when using the comment query modifier on a (3.6 <= version <= 4.2) match aggregate stage. However, testing this on a 3.6.23 server does not return an error:

Enterprise test> db.runCommand({ aggregate: "records", pipeline: [], comment: "x", cursor: {}})
{
  cursor: { firstBatch: [], id: Long("0"), ns: 'test.records' },
  ok: 1
}

It may be worth noting that the 3.6 documentation includes support for aggregation comments.

No Error on RunCommand comment for (version <= 3.2)

Similar to the above issue, BulkWrite doesn't appear to error on versions <= 3.2 if a comment is included in the run command:

> db.runCommand({ delete: "records", deletes: [], comment: "x" })
{ "ok" : 1, "n" : 0 }

However, version=3.6 does result in an error:

Enterprise test> db.runCommand({ delete: "records", deletes: [], comment: "x" })
MongoServerError: BSON field 'delete.comment' is an unknown field.



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

Author:

{'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}

Message: DRIVERS-2290 Correct ROR in YML (#1194)
Branch: master
https://github.com/mongodb/specifications/commit/b8371eac99679f072672fa9c7c3ecafb279e13f1

Comment by Preston Vasquez [ 26/Apr/22 ]

patrick.freed@mongodb.com Absolutely, I will do that right now.

Comment by Preston Vasquez [ 25/Apr/22 ]

dmitry.rybakov@mongodb.com I made a PR for this ticket with the solution of adding a minimum version to the pre 4.4 spec tests.

Comment by Preston Vasquez [ 25/Apr/22 ]

dmitry.rybakov@mongodb.com Yes, that is right.

Comment by Dmitry Rybakov [ 25/Apr/22 ]

preston.vasquez@mongodb.com It looks like the only issue left unresolved is "No Error on RunCommand comment for (version <= 3.2)" – am I right? 

Comment by Preston Vasquez [ 25/Apr/22 ]

jmikola@mongodb.com shane.harvey@mongodb.com It appears the go driver doesn't support documents for aggregation comments in any version.  The current solution in this edge case is to always convert documents to json strings in test, which is why the aggregate test in question is not resulting in an error.  Thank you for helping me understand this.

Jeremy including the "Change Stream" component was a mistake, I will remove it now.

Comment by Jeremy Mikola [ 25/Apr/22 ]

It's quite possible that older server versions were inconsistent in validating command documents for unsupported options. In that case, the easy fix for the bulkWrite test failing on <= 3.2 would be to specify a minServerVersion of 3.6 (drivers need not support earlier server versions at this point).

preston.vasquez@mongodb.com: Also, what is the relevance to the Change Stream spec here? Both tests you referenced are located within the CRUD spec.

I concur with shane.harvey@mongodb.com's assessment about the first failure in aggregate.json. The test in question is using a document comment, but the shell example you provided in the OP is using a string. Please re-confirm if the actual spec test is failing there.

I'll assign these to dmitry.rybakov@mongodb.com to follow up on.

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