Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2876

system.js + Sharding

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.8.0
    • Component/s: JavaScript, MapReduce, Sharding
    • None
    • ALL
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      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).

            Assignee:
            Unassigned Unassigned
            Reporter:
            gatesvp Gaetan Voyer-Perrault (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: