-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New TransportBroadcastUnpromotableAction action #93600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kingherc
merged 30 commits into
elastic:main
from
kingherc:feature/ES-5454-action-broadcast-to-unpromotables
Feb 15, 2023
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
022408c
New TransportBroadcastUnpromotableAction action
kingherc 90c08c0
Update docs/changelog/93600.yaml
kingherc 0f29dea
Fix style
kingherc 295670c
Fix PR comments
kingherc 16466cc
Remove ActionType
kingherc 035443a
Fix style
kingherc 19f3fe2
Rename action
kingherc 924e3d9
Fix RBACEngine checks
kingherc a88a90c
Pass IndexShardRoutingTable to action
kingherc ea98faa
Merge remote-tracking branch 'main' into feature/ES-5454-action-broad…
kingherc e3c9d6d
Fix checkstyle
kingherc a5a4572
Fix leftover TODOs
kingherc 8f2c866
Fix test
kingherc a23edcb
Rename primaryShardId to shardId
kingherc 6ed6de6
Make refresh result part of the replica request
kingherc f8de888
Do not fork again
kingherc fa3b88d
Merge remote-tracking branch 'main' into feature/ES-5454-action-broad…
kingherc 5a920e4
Fix merge conflict
kingherc e276295
Merge remote-tracking branch 'main' into feature/ES-5454-action-broad…
kingherc f802a6c
Fail if primary customization logic fails
kingherc bc535c3
Register new exception
kingherc 0ce144d
Add new exception to test
kingherc cfadcd7
Fail unpromotable like replica shard failures
kingherc 9599493
Null node throws NodeNotConnectedException
kingherc 99c2fe1
Revert changing private fields in routing class
kingherc 86cfd68
Small PR comment
kingherc 2b9fb3f
Broadcast request implements IndicesRequest
kingherc d1c3f10
Fix checkstyle
kingherc 4d1598a
Small serialization optimization
kingherc 0146161
Merge remote-tracking branch 'main' into feature/ES-5454-action-broad…
kingherc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 93600 | ||
summary: New `TransportBroadcastUnpromotableAction` action | ||
area: CRUD | ||
type: feature | ||
issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../main/java/org/elasticsearch/action/admin/indices/refresh/ShardRefreshReplicaRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.action.admin.indices.refresh; | ||
|
||
import org.elasticsearch.action.support.replication.ReplicationRequest; | ||
import org.elasticsearch.common.io.stream.StreamInput; | ||
import org.elasticsearch.index.engine.Engine; | ||
import org.elasticsearch.index.shard.ShardId; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A request that is sent to the promotable replicas of a primary shard | ||
*/ | ||
public class ShardRefreshReplicaRequest extends ReplicationRequest<ShardRefreshReplicaRequest> { | ||
|
||
/** | ||
* Holds the refresh result of the primary shard. This will be used by {@link TransportShardRefreshAction} to construct a | ||
* {@link UnpromotableShardRefreshRequest} to broadcast to the unpromotable replicas. The refresh result is not serialized to maintain | ||
* backwards compatibility for the refresh requests to promotable replicas which do not need the refresh result. For this reason, the | ||
* field is package-private. | ||
*/ | ||
final Engine.RefreshResult primaryRefreshResult; | ||
|
||
public ShardRefreshReplicaRequest(StreamInput in) throws IOException { | ||
super(in); | ||
primaryRefreshResult = Engine.RefreshResult.NO_REFRESH; | ||
} | ||
|
||
public ShardRefreshReplicaRequest(ShardId shardId, Engine.RefreshResult primaryRefreshResult) { | ||
super(shardId); | ||
this.primaryRefreshResult = primaryRefreshResult; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ShardRefreshReplicaRequest{" + shardId + "}"; | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.