[SERVER-28276] createCollection masserts on illegal namespaces Created: 10/Mar/17  Updated: 23/Oct/17  Resolved: 18/Oct/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc1

Type: Improvement Priority: Minor - P4
Reporter: Eric Milkie Assignee: Xiangyu Yao (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Storage 2017-10-23
Participants:

 Description   

See repro. We should probably just uassert for this, to avoid filling the system log with unnecessary backtraces.

Repro steps:
1. start mongod
2. start mongo shell
3. issue shell commands:

> use $bad
switched to db $bad
> db.createCollection("a")
{
	"operationTime" : Timestamp(0, 0),
	"ok" : 0,
	"errmsg" : "cannot do createCollection on namespace with a $ in it: $bad.a",
	"code" : 17320,
	"codeName" : "Location17320"
}

4. observe backtrace in mongod system log

Expected behavior: step 4 should observe no backtrace.



 Comments   
Comment by Githook User [ 18/Oct/17 ]

Author:

{'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao', 'username': 'xy24'}

Message: SERVER-28276 Changes massertNamespaceNotIndex to uassertNamespaceNotIndex
Branch: master
https://github.com/mongodb/mongo/commit/bc4d5001d76b5b2e9e598b44c87f0f58030603ea

Comment by Xiangyu Yao (Inactive) [ 16/Oct/17 ]

After this commit for SERVER-30702, the massert no longer prints a back trace. However, it still prints a one-line mesage:

[conn1] Assertion: 17320:cannot do createCollection on namespace with a $ in it: $bad.a sr
c/mongo/db/catalog/database_impl.cpp 101

Therefore, I am still going to change massert to uassert to prevent this.

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