[SERVER-47647] Duplicate key error message has incorrect namespace after rename Created: 17/Apr/20  Updated: 29/Oct/23  Resolved: 19/Oct/20

Status: Closed
Project: Core Server
Component/s: Catalog, Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-47873 Eliminate the Collection* saved in In... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

> db.x.insert({_id:1})
WriteResult({ "nInserted" : 1 })
> db.x.renameCollection("y")
{ "ok" : 1 }
> db.y.insert({_id:1})
WriteResult({
	"nInserted" : 0,
	"writeError" : {
		"code" : 11000,
		"errmsg" : "E11000 duplicate key error collection: test.x index: _id_ dup key: { _id: 1.0 }"
	}
})

Sprint: Execution Team 2020-09-07, Execution Team 2020-09-21, Execution Team 2020-10-05, Execution Team 2020-10-19, Execution Team 2020-11-02
Participants:

 Description   

The WiredTigerIndex class stores a copy of the collection name in a _collectionNamespace constant, but this becomes invalid on rename. Indeed the index should not refer back to its parent collection as that can change.



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

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-47647 Test that duplicate key error message has correct namespace after rename
Branch: master
https://github.com/mongodb/mongo/commit/1e9b12b0f58fef211740546d5d162694d5cbbcf7

Comment by Geert Bosch [ 29/Jun/20 ]

Only work remaining is adding a test case.

Comment by Geert Bosch [ 29/Jun/20 ]

Removing the Collection* from the IndexDescriptor fixed this issue.

Generated at Thu Feb 08 05:14:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.