[SERVER-28640] Implement Return CanNotTargetItself error from Shard::runCommand Created: 05/Apr/17  Updated: 06/Dec/22  Resolved: 20/Nov/17

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

Type: Improvement Priority: Major - P3
Reporter: Misha Tyulenev Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Currently its possible to run a command on the node that schedules it via
ShardRemote::runCommand. Instead the ShardRemote instance should return a new ErrorCode::CanNotTargetItself. This will allow clients that call it to catch the error and implement a different scenario. e.g. running the command locally.
The possible implementation is to make RemoteCommandTargeter::findHost issue an error if its requested to "target itself". The code written as a part of SERVER-27772 fix needs to address the change when its done.



 Comments   
Comment by Andy Schwerin [ 05/Apr/17 ]

I wouldn't bother reusing an existing code unless it is semantically identical.

Comment by Spencer Brody (Inactive) [ 05/Apr/17 ]

Could probably use the existing NotSecondary code for this rather than adding a new code

Generated at Thu Feb 08 04:18:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.