Skip to content
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

Add target_node_name for REPLACE shutdown type #77151

Merged
merged 9 commits into from
Sep 3, 2021

Conversation

gwbrown
Copy link
Contributor

@gwbrown gwbrown commented Sep 1, 2021

This commit extends the REPLACE shutdown type to support a new
target_node_name field, which will control the node used to replace
the one that is to shut down. However, only the data layer is present as
of this PR.

Also adjusts the serialization/deserialization for the REPLACE type to
handle mixed-version clusters.

Relates to #70338

This commit extends the `REPLACE` shutdown type to support a new
`target_node_name` field, which will control the node used to replace
the one that is to shut down. However, only the data layer is present as
of this PR.

Also adjusts the serialization/deserialization for the REPLACE type to
handle mixed-version clusters.
@gwbrown gwbrown requested a review from dakrone September 1, 2021 20:58
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Sep 1, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some super minor comments but nothing major

@@ -102,6 +111,7 @@ private SingleNodeShutdownMetadata(
throw new IllegalArgumentException("shard allocation delay is only valid for RESTART-type shutdowns");
}
this.allocationDelay = allocationDelay;
this.targetNodeName = targetNodeName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We validate that there is an allocation delay only specified for the RESTART type, so we should also validate that the target note is only specified for a REPLACE type shutdown here I think

public SingleNodeShutdownMetadata build() {
if (startedAtMillis == -1) {
throw new IllegalArgumentException("start timestamp must be set");
}

if (targetNodeName != null && type != Type.REPLACE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing this validate in the constructor instead would be better, since we do the validation for the shard delay there also

SingleNodeShutdownMetadata.Type type,
String reason,
@Nullable TimeValue allocationDelay,
String targetNodeName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor

Suggested change
String targetNodeName
@Nullable String targetNodeName

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Gordon!

@gwbrown gwbrown merged commit b2a9328 into elastic:master Sep 3, 2021
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Sep 3, 2021
This commit extends the `REPLACE` shutdown type to support a new
`target_node_name` field, which will control the node used to replace
the one that is to shut down. However, only the data layer is present as
of this PR.

Also adjusts the serialization/deserialization for the REPLACE type to
handle mixed-version clusters.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
7.x

wjp719 added a commit to wjp719/elasticsearch that referenced this pull request Sep 4, 2021
* master: (128 commits)
  Mute DieWithDignityIT (elastic#77283)
  Fix randomization in MlNodeShutdownIT (elastic#77281)
  Add target_node_name for REPLACE shutdown type (elastic#77151)
  [DOCS] Adds information about version compatibility headers (elastic#77096)
  Fix template equals when mappings are wrapped (elastic#77008)
  Fix TextFieldMapper Retaining a Reference to its Builder (elastic#77251)
  Move die with dignity to be a test module (elastic#77136)
  Update task names for rest compatiblity (elastic#75267)
  [ML] adjusting bwc serialization for elastic#77256 (elastic#77257)
  Move `index.hidden` from Static to Dynamic settings (elastic#77218)
  Handle cgroups v2 in `OsProbe` (elastic#77128)
  Choose postings format from FieldMapper instead of MappedFieldType (elastic#77234)
  Add segment sorter for data streams (elastic#75195)
  Update skip after backport (elastic#77212)
  [ML] adding new defer_definition_decompression parameter to put trained model API (elastic#77189)
  [ML] Fix bug in inference stats persister for when feature reset is called
  Only check replicas in cancelling existing recoveries. (elastic#60564)
  Format `AbstractFilteringTestCase` (elastic#77217)
  [DOCS] Fixes line breaks. (elastic#77248)
  Convert 'routing' values in REST API tests to strings
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java
gwbrown added a commit that referenced this pull request Sep 7, 2021
gwbrown added a commit that referenced this pull request Sep 7, 2021
This commit extends the `REPLACE` shutdown type to support a new
`target_node_name` field, which will control the node used to replace
the one that is to shut down. However, only the data layer is present as
of this PR.

Also adjusts the serialization/deserialization for the REPLACE type to
handle mixed-version clusters.

Also includes content of #77281 and #77304, follow-ups to the original
PR which fix various test issues.

Co-authored-by: David Roberts <[email protected]>
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Sep 7, 2021
This commit adjusts the serialization version and re-enabled BWC tests
following the backport of elastic#77151.
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Sep 7, 2021
gwbrown added a commit that referenced this pull request Sep 7, 2021
This commit adjusts the serialization version and re-enables BWC tests
following the backport of #77151.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Node Lifecycle Node startup, bootstrapping, and shutdown >non-issue Team:Core/Infra Meta label for core/infra team v7.16.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants