[SERVER-2876] system.js + Sharding Created: 31/Mar/11  Updated: 31/Mar/11  Resolved: 31/Mar/11

Status: Closed
Project: Core Server
Component/s: JavaScript, MapReduce, Sharding
Affects Version/s: 1.8.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Gaetan Voyer-Perrault Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

When depending on JS stored on the server side the functionality fails if a collection is a sharded.

Server-side JS:
http://www.mongodb.org/display/DOCS/Server-side+Code+Execution#Server-sideCodeExecution-Storingfunctionsserverside

Looking at the Sharding Limits, this is not clearly stated:
http://www.mongodb.org/display/DOCS/Sharding+Limits

There's a mention that db.eval() fails, but no clarification that this includes server-side JS. Additionally, the docs state that $where works, but if the $where is dependent on the server-side JS, then it too will fail.

In theory, this can be worked around by adding the same function to each shard individually, but this is bad practice.

======
Options:

1. Disallow server-side JS in sharded scenarios
2. Add this functionality so that server-side JS is "replicated" across shards

======

In case #1, we get an instance where mongoS behaves differently than mongoD
In case #2, we get consistent behavior between mongoS and mongoD, but we have to implement special behavior for a particular collection (mind you it is a system collection).



 Comments   
Comment by Eliot Horowitz (Inactive) [ 31/Mar/11 ]

SERVER-925

Generated at Thu Feb 08 03:01:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.