When you tell a Scope instance to load procedures from system.js, it uses a version number to decide whether the contents of system.js are unchanged. When the version number matches, it does nothing; when the version number is different, it does the actual work of loading stored procedures.
The problem is, the Scope instance updates its version number before doing the work, so if an exception happens during the work, the Scope thinks it's up to date when it's not.
To fix it we can move this line to the bottom of the function: https://github.com/mongodb/mongo/blob/master/src/mongo/scripting/engine.cpp#L227
- is duplicated by
-
SERVER-47168 ensure replication of the system.js collection in system_js_access test
- Closed