[DOCS-13508] Investigate changes in SERVER-44333: mongos accepts empty wc on commands that don't support writeConcern Created: 11/Mar/20  Updated: 13/Nov/23  Due: 20/Mar/20  Resolved: 20/Mar/20

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Andrew Feierabend (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-44333 mongos accepts empty wc on commands t... Closed
Participants:
Days since reply: 3 years, 46 weeks, 5 days ago
Epic Link: DOCS: 4.4 Server Release Work

 Description   

Description

Downstream Change Summary

mongos no longer accepts an empty wc on commands that do not support write concern (e.g., ping). This behavior is now consistent with mongod.

Description of Linked Ticket

This is inconsistent with mongod, which always rejects the writeConcern field on commands where supportsWriteConcern() returns false.

The problem is that this check is using !wcResult.usedDefault, rather than something like request.body.hasField(WriteConcernOptions::kWriteConcernField).

mongod:

> db.runCommand({ping:1, writeConcern:{w:1}})
{
        "ok" : 0,
        "errmsg" : "Command does not support writeConcern",
        "code" : 72,
        "codeName" : "InvalidOptions"
}
> db.runCommand({ping:1, writeConcern:{}})
{
        "ok" : 0,
        "errmsg" : "Command does not support writeConcern",
        "code" : 72,
        "codeName" : "InvalidOptions"
}

mongos:

mongos> db.runCommand({ping:1, writeConcern:{w:1}})
{
        "ok" : 0,
        "errmsg" : "Command does not support writeConcern",
        "code" : 72,
        "codeName" : "InvalidOptions",
        "operationTime" : Timestamp(1572499322, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1572499322, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}
mongos> db.runCommand({ping:1, writeConcern:{}})
{
        "ok" : 1,
        "operationTime" : Timestamp(1572499322, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1572499322, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 20/Mar/20 ]

Author:

{'email': 'andrew.feierabend@mongodb.com', 'name': 'Andrew Feierabend', 'username': 'andf-mongodb'}

Message: DOCS-13508 add changelog entry for writeconcern error in mongos
Branch: master
https://github.com/mongodb/docs/commit/93f58ce18d64b4d727d63eacbba22bd45aac789a

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