Conversation
There was a problem hiding this comment.
This exception will be treated as ignore replica exception. 😉
There was a problem hiding this comment.
I think this check is wrong. When we have relocation going on and relocation source is marked as relocated (i.e. we call executeRemotely in TransportReplicationAction), then we have primary relocation target replicating back to primary relocation source (see also ReplicationPhase).
|
@jasontedor pushed an update to those exceptions... sadly testing is harder (but will be possible with new testing infra I'm working on...) |
There was a problem hiding this comment.
I guess this can be reused to replace routedBasedOnClusterVersion (#16274). Yay 👍
There was a problem hiding this comment.
interesting idea - it's currently not incremented when relocating a primary though... requires more thought.
|
Thanks @bleskes for porting this to master. Primary terms will be really helpful in many kind of resiliency-related scenarios (solved previously with ugly hacks, e.g. |
|
@ywelsch I pushed a new implementation. I'm starting to warm up to making shard routing immutable on the index shard level (different PR, and not now :)) |
|
Pushed another commit fixing a side effect of changing the exception types from IllegalShardStateException to IllegalArgumentException (to help with #17038 ) - the replica wrapper shouldn't fail shards locally anymore (technical engine level errors are still dealt with by the engine), but leave it to the primary. It was originally added in #5847 but with current machinery it's not needed. It's also useful to note that adding assertions of the terms invariants to IndexShard forced some clean ups in IndicesClusterService (as @ywelsch already suspected). I will update the PR description with these and whatever else we find once the review cycles are done. |
Primary terms is a way to make sure that operations replicated from stale primary are rejected by shards following a newly elected primary.
Original PRs adding this to the seq# feature branch #14062 , #14651
Relates to #17038