-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.1.9
-
Component/s: JavaScript
-
Sharding 2016-08-29
Running the eval command on a mongos will not implicitly create the database, while running it on a mongod will. These two behaviors should be consistent. If the database doesn't exist, the command should always create it, or never create it, regardless of whether it's talking to a mongos or a mongod.
Because mongos cannot create a representation of the database without writing durable data, the behavior of mongod should be changed to match that of mongos.
This behavior was noticed while running a patch build using the --shuffle option to resmoke.py, eval7.js failed during the sharded_collections_jscore_passthrough suite with the following message:
[js_test:eval7] 2015-10-09T03:32:13.811+0000 2015-10-09T03:32:13.811+0000 E QUERY [thread1] Error: { "ok" : 0, "errmsg" : "database test not found", "code" : 26 } : [js_test:eval7] 2015-10-09T03:32:13.811+0000 _getErrorWithCode@src/mongo/shell/utils.js:23:13 [js_test:eval7] 2015-10-09T03:32:13.811+0000 DB.prototype.eval@src/mongo/shell/db.js:553:1 [js_test:eval7] 2015-10-09T03:32:13.811+0000 @jstests/core/eval7.js:2:16
This normally doesn't fail, as it usually isn't the first test to run, and the database will already exist by then.
- is depended on by
-
SERVER-20414 Configure Evergreen to run more suites in parallel
- Closed