[SERVER-45456] Allow JavaScript on mongos Created: 09/Jan/20  Updated: 29/Oct/23  Resolved: 07/Feb/20

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

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-45455 Use a merging shard to prevent JS fai... Closed
Documented
is documented by DOCS-13387 Investigate changes in SERVER-45456: ... Closed
Duplicate
is duplicated by SERVER-42637 Add server-side JavaScript support to... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2020-01-27, Query 2020-02-10
Participants:

 Description   

When the mergerPart of an aggregation contains Javascript, we need to pick a shard to do the merge, because mongos doesn't support Javascript today. On allowing Javascript execution on mongos, we can instead keep the merge local. This will be useful for reducing latency (one fewer hop), and for reducing the load on the shards (by moving the work to mongos).



 Comments   
Comment by Githook User [ 07/Feb/20 ]

Author:

{'username': 'jameswahlin', 'name': 'James Wahlin', 'email': 'james@mongodb.com'}

Message: SERVER-45456 Allow JavaScript on mongos

create mode 100644 jstests/noPassthrough/mr_noscripting.js
delete mode 100644 jstests/noPassthroughWithMongod/mr_noscripting.js
create mode 100644 jstests/sharding/agg_js_on_mongos.js
create mode 100644 jstests/sharding/javascript_heap_limit.js
Branch: master
https://github.com/mongodb/mongo/commit/0f36fdce71df08aa7c0703bda69a7045f96f41c8

Comment by James Wahlin [ 15/Jan/20 ]

As part of allowing JavaScript on mongos, we will reduce the max Javascript heap size default to 100MB, as mongos processes are often run on machines with fewer resources than cluster shards. This setting will be configurable.

Additionally mongos will allow Javascript to be disabled via configuration file or command line parameter, as is the case currently for mongod.

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