[SERVER-15919] add namespace and key to duplicate key error in heap1 Created: 03/Nov/14  Updated: 03/Nov/16  Resolved: 03/Nov/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.7.8
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Derick Rethans Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

> use test2
switched to db test2
> db.test.createIndex( { filename: 1 }, { unique: 1 } );
{
	"createdCollectionAutomatically" : true,
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"ok" : 1
}
> db.test.insert( { filename: "test" } );
WriteResult({ "nInserted" : 1 })
> db.test.insert( { filename: "test" } );
WriteResult({
	"nInserted" : 0,
	"writeError" : {
		"code" : 11000,
		"errmsg" : "E11000 duplicate key error dup key: { : \"test\" }"
	}
})

(Tested with nightly mongodb-linux-x86_64-f5e67009ead674efb7cf16da2c1c462cc99424db-2014-10-30)

Participants:

 Description   

In mmapv1, a duplicate key error looks like:

error message: Could not store file: %s:%d:%sE11000 duplicate key error index: phpunit.test_prefix.files.$filename_1%Sdup key: { : "test.txt" }

With heap1, it looks like:

error message: Could not store file: 127.0.0.1:30000: E11000 duplicate key error dup key: { : "test.txt" }

It does not include the database name, collection name, or key name.


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