[CDRIVER-2782] Fake an {ok: 1} reply for unacknowledged writes with OP_MSG Created: 01/Aug/18  Updated: 28/Oct/23  Resolved: 02/Aug/18

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.13.0

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1386 Implement command monitoring API Closed

 Description   

While working on implementing the command monitoring spec tests in C++, spencer.mckenney found one test that was failing: unacknowledgedBulkWrite.json It fails because the reply in the command succeeded event is an empty document, but the spec tests expect a reply of ok:1. According to the spec:

For server versions that do not support write commands, the driver MUST treat an acknowledged write as a single command event, where the GLE command is ignored as a started event and the response to the GLE is treated as the reply in the CommandSucceededEvent. Unacknowledged writes must provide a CommandSucceededEvent with a ok:1 reply.

IIUC this is saying we should always generate an ok:1 reply. But the path for OP_MSG writes doesn't. Instead we fake the ok:1 in our tests.

I think we should actually generate the fake ok:1 for unacknowledged OP_MSG writes. From what I've looked at, it's a straightforward fix.



 Comments   
Comment by Githook User [ 02/Aug/18 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CDRIVER-2782 fake ok:1 reply for w:0 writes
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/e5df2b084d11e4ce6368be1b59f1844514384beb

Generated at Wed Feb 07 21:16:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.