[SERVER-13421] verboseShell error messaging is redundant in non-legacy writes modes Created: 31/Mar/14  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.0-rc2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kamran K. Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: 26qa, move-sa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Steps To Reproduce:

setVerboseShell(true);
db.test1.drop();
 
db.test1.insert({_id: 'a'});
db.test1.insert({_id: 'a'});

Participants:

 Description   

Using setVerboseShell(true) with 'compatibility' or 'commands' writes leads to duplicate error messages in the shell. This bug seems like it will affect any caller of DBCollection.prototype._printExtraInfo.

Write Commands:

> setVerboseShell(true);
> db.test1.drop();
true
> 
> db.test1.insert({_id: 'a'});
Inserted 1 record(s) in 6ms
WriteResult({ "nInserted" : 1 })
> db.test1.insert({_id: 'a'});
insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.test1.$_id_  dup key: { : "a" }
WriteResult({
	"nInserted" : 0,
	"writeError" : {
		"code" : 11000,
		"errmsg" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.test1.$_id_  dup key: { : \"a\" }"
	}
})

Compatibility mode:

> setVerboseShell(true);
> db.getMongo().forceWriteMode('compatibility');
> db.test1.drop();
false
> 
> db.test1.insert({_id: 'a'});
Inserted 1 record(s) in 416ms
WriteResult({ "nInserted" : 1 })
> db.test1.insert({_id: 'a'});
insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.test1.$_id_  dup key: { : "a" }
WriteResult({
	"nInserted" : 0,
	"writeError" : {
		"code" : 11000,
		"errmsg" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.test1.$_id_  dup key: { : \"a\" }"
	}
})

Legacy mode:

> setVerboseShell(true);
> db.getMongo().forceWriteMode('legacy');
> db.test1.drop();
true
> 
> db.test1.insert({_id: 'a'});
Inserted 1 record(s) in 2ms
> db.test1.insert({_id: 'a'});
insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.test1.$_id_  dup key: { : "a" }


Version: a12d09c9757301c3872cf4b45027d287e3dcc366



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Generated at Thu Feb 08 03:31:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.