[SERVER-22421] Add writeConcernError backwards compatibility to User Management Commands Created: 01/Feb/16  Updated: 24/Apr/18  Resolved: 12/Apr/16

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-28871 Remove write concern error backwards ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 10 (02/19/16), Sharding 11 (03/11/16), Sharding 12 (04/01/16), Sharding 13 (04/22/16)
Participants:

 Description   

When they receive a writeConcernError, write commands should return a response with the format:

{
    ok: 1,
    ...
    writeConcernError: {
        code: <number>,
        errmsg: <string>
    }
}

User Managements Commands currently have a response format of

{"ok" : 0, "errmsg" : "timeout", "code" : 8 }

. These commands need to return the new format in addition to or instead of the old format. To do so, inside of Command::run(), when we get a writeConcernError we will simply check if the command is a UserManagementCommand and if so we will set ok to 0, and add "errmsg" and "code" fields with the errmsg and code from the writeConcernError.



 Comments   
Comment by Judah Schvimer [ 17/Jan/18 ]

SERVER-28871 should take care of that.

Comment by Gabriel Russell (Inactive) [ 17/Jan/18 ]

judah.schvimer, I just saw this comment in master:

 367     // SERVER-22421: This code is to ensure error response backwards compatibility with the                                              
 368     // user management commands. This can be removed in 3.6.                                                                             

https://github.com/mongodb/mongo/blob/a6e45f0e35724ae7958e31fc141c89afcefe4d33/src/mongo/db/service_entry_point_mongod.cpp#L367

I just wanted to alert you in case you wanted to get that code removed.

Comment by Githook User [ 12/Apr/16 ]

Author:

{u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}

Message: SERVER-22421 writeConcernError backwards compatibility for user management commands
Branch: master
https://github.com/mongodb/mongo/commit/8b2e8b846799db19cb51f626b8c9802f2d4fcabc

Generated at Thu Feb 08 04:00:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.