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

Investigate how to stop using ShardLocal

      The Shard interface is difficult to use, and leads to bugs.  There are two implementations of the Shard interface: ShardLocal and ShardRemote.  However, they are not interchangeable.  Throughout the ShardLocal class, many functions hit a MONGO_UNREACHABLE, despite the fact that we usually call these functions through the base class Shard.

      Furthermore, the Shard interface supports a generic `runCommand` function that at first glance seems to support arbitrary server commands. However, this is not the case for multiple reasons.  First, DBDirectClient (which ShardLocal wraps) only supports CRUD operations.  Second, DBDirectClient does not support session information in commands.

      We should use ShardRemote instead of ShardLocal when the CSRS talks to itself.  

      There may exist times when the CSRS absolutely must bypass the networking stack.  In those cases we should use a thin wrapper on DBDirectClient that enforces the limitations of DBDirectClient in its API and does not derive Shard (ShardLocal does not satisfy these conditions).

       

      These issues have greatly complicated PM-2290.

            Assignee:
            andrew.witten@mongodb.com Andrew Witten (Inactive)
            Reporter:
            andrew.witten@mongodb.com Andrew Witten (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: