-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
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.
- is duplicated by
-
SERVER-66711 Get rid of ShardLocal
- Closed