Extend reroute with an option to force assign stale primary shard copies#15708
Conversation
There was a problem hiding this comment.
Should this use the ObjectParser? I think everything is going that way.
There was a problem hiding this comment.
I essentially copy pasted this stuff from the AllocateAllocationCommand. You are right though, I should transform it to use ObjectParser.
|
@ywelsch and I discussed this yesterday. Here is the gist of the discussion:
Here's a suggest for how the rest layer will look like for that: Note the @ywelsch thoughts? |
|
Before this PR, users only had the possibility to either allocate a replica or an empty primary. The flag "allow_primary" was misleading in that context. I would very much like to get rid of this flag altogether and introduce something new. What about introducing a new "mode" field: "mode": "replica" // default, only allocates unassigned replica shard (fails if unassigned primary exists) "mode": "replica" is equivalent to the old "allowPrimary" : "false" Also, we should check for consistency with the cancel command that currently has an "allowPrimary" flag as well. |
|
Also, relates to #14352 |
|
I think mode is a bit ambiguous as a flag. I do understand the concerns that |
sorry ;-) |
|
We have a stalled issue (#14352) about choosing a better name for Instead, what about changing the action name from
@s1monw is concerned about exposing these last two actions via the API and would prefer to provide a command line tool (perhaps as a plugin) to do this job instead. The idea is to make it harder for users to make a change that will delete data, and will hopefully force them to read about the consequences of their action. While I understand this sentiment, I'm not convinced that a command line tool is the way to go here. ES is API driven so this would be quite a change from what we do today, and there are probably many users who don't have command line access to their hosted clusters, and who need to fix a problem quickly without having to wait for support to respond to their tickets. Instead, I'd propose adding an |
|
+1. My only suggestion would be to use 'force_empty_primary' and 'force_stale_primary' as command names, to make it even clearer that (all) shard content will be lost. On 9 jan. 2016 12:13 PM +0100, Clinton Gormleynotifications@github.com, wrote:
|
7cb4da8 to
17541c1
Compare
|
@bleskes @clintongormley I pushed a new set of changes reflecting the naming suggested by @clintongormley. This new changeset also contains documentation for the new commands. Two open points remain for me:
@bleskes What I don't like about |
There was a problem hiding this comment.
Since this is a major rewrite anyway, can we try to move from custom factories to NamedWriteableRegistry ?
There was a problem hiding this comment.
I see now that MoveAllocationCommand is not touched by the PR. I think moving to NamedWriteableRegistry is a good idea, but I'm fine with putting it out of scope for this PR
There was a problem hiding this comment.
see text from other suggestion for empty primary allocation
|
Thanks @ywelsch . I really like how it turned out. Left some minor comments here and there. |
|
pushed another round of changes addressing the comments. Please have another look @bleskes. (The |
There was a problem hiding this comment.
I think this can be made simpler by just creating a one node cluster, create an index with no replicas, add a node to the cluster. Shutdown the first node and force assign. Makes sense?
|
LGTM. Made one suggestion for simplifying a test (and asked a question). Feel free to adopt the suggestion (or not) and push. Thanks for all the iterations, @ywelsch . |
fe93318 to
d5b691b
Compare
|
Thanks for the thorough review @bleskes ! |
Extend reroute with an option to force assign stale primary shard copies
Relates to #14739.