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

[Transforms] fix bug when unsetting retention policy #87711

Conversation

benwtrent
Copy link
Member

It is currently not possible to unset the retention policy in a typical multi-node cluster.

This commit fixes that bug. If unsetting the retention policy failed, it would fail looking like the following error:

An error occurred calling the API endpoint to update transforms.
Bad Request: [illegal_argument_exception: [illegal_argument_exception] Reason: 
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]]:
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]

closes: #87688

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

Hi @benwtrent, I've created a changelog YAML for you.

@@ -534,6 +535,11 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
TransformField.TIME.getPreferredName(),
TimeRetentionPolicyConfig::new
),
new NamedWriteableRegistry.Entry(
Copy link
Member

Choose a reason for hiding this comment

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

TransformNamedXContentProvider is also missing the NullRetentionPolicyConfig named writable

Copy link
Member Author

Choose a reason for hiding this comment

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

@davidkyle it isn't required. This thing is never written to XContent. But I can add it for completeness.

Copy link
Member

Choose a reason for hiding this comment

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

Please do I think it is worth having to avoid a similar problem in future

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@benwtrent benwtrent merged commit f9d57e2 into elastic:master Jun 16, 2022
@benwtrent benwtrent deleted the bugfix/ml-transforms-fix-unsetting-retention-policy branch June 16, 2022 13:12
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 16, 2022
It is currently not possible to unset the retention policy in a typical multi-node cluster. 

This commit fixes that bug. If unsetting the retention policy failed, it would fail looking like the following error:

```
An error occurred calling the API endpoint to update transforms.
Bad Request: [illegal_argument_exception: [illegal_argument_exception] Reason: 
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]]:
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]
```

closes: elastic#87688
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 16, 2022
It is currently not possible to unset the retention policy in a typical multi-node cluster. 

This commit fixes that bug. If unsetting the retention policy failed, it would fail looking like the following error:

```
An error occurred calling the API endpoint to update transforms.
Bad Request: [illegal_argument_exception: [illegal_argument_exception] Reason: 
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]]:
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]
```

closes: elastic#87688
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.3
8.2

elasticsearchmachine pushed a commit that referenced this pull request Jun 16, 2022
It is currently not possible to unset the retention policy in a typical multi-node cluster. 

This commit fixes that bug. If unsetting the retention policy failed, it would fail looking like the following error:

```
An error occurred calling the API endpoint to update transforms.
Bad Request: [illegal_argument_exception: [illegal_argument_exception] Reason: 
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]]:
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]
```

closes: #87688
elasticsearchmachine pushed a commit that referenced this pull request Jun 16, 2022
It is currently not possible to unset the retention policy in a typical multi-node cluster. 

This commit fixes that bug. If unsetting the retention policy failed, it would fail looking like the following error:

```
An error occurred calling the API endpoint to update transforms.
Bad Request: [illegal_argument_exception: [illegal_argument_exception] Reason: 
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]]:
Unknown NamedWriteable [org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig][null_retention_policy]
```

closes: #87688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Transform] Error when removing retention policy
4 participants