Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2782

Fake an {ok: 1} reply for unacknowledged writes with OP_MSG

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: