Skip to content

Fix ComposableIndexTemplate equals when composed_of is null#80864

Merged
dakrone merged 3 commits intoelastic:masterfrom
weizijun:Fix-template-equals-when-component-is-null
Nov 29, 2021
Merged

Fix ComposableIndexTemplate equals when composed_of is null#80864
dakrone merged 3 commits intoelastic:masterfrom
weizijun:Fix-template-equals-when-component-is-null

Conversation

@weizijun
Copy link
Copy Markdown
Contributor

when composed_of is null, the ComposableIndexTemplate will return an empty list. it will cause the input and output ComposableIndexTemplate not equals.

reproduce:
in ComposableIndexTemplateTests.randomInstance method, make List<String> componentTemplates = null;, there are the failed tests:

Tests with failures:
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testAddIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2Wildcards
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testUpdateIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2

the PR add a componentTemplatesEquals method to make null and empty list equals .

@elasticsearchmachine elasticsearchmachine added v8.1.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Nov 19, 2021
@weizijun
Copy link
Copy Markdown
Contributor Author

hi, @dakrone, can you help to review this PR?

I push a PR(#77008) before about mapping equals, and I find another not equals case.

@jtibshirani jtibshirani added the :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. label Nov 20, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Nov 20, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@dakrone dakrone self-requested a review November 29, 2021 19:13
@dakrone
Copy link
Copy Markdown
Member

dakrone commented Nov 29, 2021

@elasticmachine update branch

@dakrone
Copy link
Copy Markdown
Member

dakrone commented Nov 29, 2021

@elasticmachine ok to test

@dakrone
Copy link
Copy Markdown
Member

dakrone commented Nov 29, 2021

@elasticmachine update branch

Copy link
Copy Markdown
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, I'll merge this in.

@dakrone dakrone merged commit 2629c32 into elastic:master Nov 29, 2021
dakrone pushed a commit to dakrone/elasticsearch that referenced this pull request Nov 29, 2021
…80864)

when composed_of is null, the ComposableIndexTemplate will return an empty list. it will cause the input and output ComposableIndexTemplate not equals.

reproduce:
in ComposableIndexTemplateTests.randomInstance method, make `List<String> componentTemplates = null;`, there are the failed tests:
```
Tests with failures:
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testAddIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2Wildcards
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testUpdateIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2
```

the PR add a `componentTemplatesEquals` method to make null and empty list equals .
elasticsearchmachine pushed a commit that referenced this pull request Nov 30, 2021
…81132)

when composed_of is null, the ComposableIndexTemplate will return an empty list. it will cause the input and output ComposableIndexTemplate not equals.

reproduce:
in ComposableIndexTemplateTests.randomInstance method, make `List<String> componentTemplates = null;`, there are the failed tests:
```
Tests with failures:
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testAddIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2Wildcards
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testUpdateIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2
```

the PR add a `componentTemplatesEquals` method to make null and empty list equals .

Co-authored-by: weizijun <weizijun1989@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@weizijun
Copy link
Copy Markdown
Contributor Author

LGTM, I'll merge this in.

Thanks @dakrone

weizijun added a commit to weizijun/elasticsearch that referenced this pull request Nov 30, 2021
* upstream/master: (150 commits)
  Fix ComposableIndexTemplate equals when composed_of is null (elastic#80864)
  Optimize DLS bitset building for matchAll query (elastic#81030)
  URL option for BaseRunAsSuperuserCommand (elastic#81025)
  Less Verbose Serialization of Snapshot Failure in SLM Metadata (elastic#80942)
  Fix shadowed vars pt7 (elastic#80996)
  Fail shards early when we can detect a type missmatch (elastic#79869)
  Delegate Ref Counting to ByteBuf in Netty Transport (elastic#81096)
  Clarify `unassigned.reason` docs (elastic#81017)
  Strip blocks from settings for reindex targets (elastic#80887)
  Split off the values supplier for ScriptDocValues (elastic#80635)
  [ML] Switch message and detail for model snapshot deprecations (elastic#81108)
  [DOCS] Update xrefs for snapshot restore docs (elastic#81023)
  [ML] Updates visiblity of validate API (elastic#81061)
  Track histogram of transport handling times (elastic#80581)
  [ML] Fix datafeed preview with remote indices (elastic#81099)
  [ML] Fix acceptable model snapshot versions in ML deprecation checker (elastic#81060)
  [ML] Add logging for failing PyTorch test (elastic#81044)
  Extending the timeout waiting for snapshot to be ready (elastic#81018)
  [ML] Fix incorrect logging of unexpected model size error (elastic#81089)
  [ML] Make inference timeout test more reliable (elastic#81094)
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Nov 30, 2021
* upstream/master: (55 commits)
  Fix ComposableIndexTemplate equals when composed_of is null (elastic#80864)
  Optimize DLS bitset building for matchAll query (elastic#81030)
  URL option for BaseRunAsSuperuserCommand (elastic#81025)
  Less Verbose Serialization of Snapshot Failure in SLM Metadata (elastic#80942)
  Fix shadowed vars pt7 (elastic#80996)
  Fail shards early when we can detect a type missmatch (elastic#79869)
  Delegate Ref Counting to ByteBuf in Netty Transport (elastic#81096)
  Clarify `unassigned.reason` docs (elastic#81017)
  Strip blocks from settings for reindex targets (elastic#80887)
  Split off the values supplier for ScriptDocValues (elastic#80635)
  [ML] Switch message and detail for model snapshot deprecations (elastic#81108)
  [DOCS] Update xrefs for snapshot restore docs (elastic#81023)
  [ML] Updates visiblity of validate API (elastic#81061)
  Track histogram of transport handling times (elastic#80581)
  [ML] Fix datafeed preview with remote indices (elastic#81099)
  [ML] Fix acceptable model snapshot versions in ML deprecation checker (elastic#81060)
  [ML] Add logging for failing PyTorch test (elastic#81044)
  Extending the timeout waiting for snapshot to be ready (elastic#81018)
  [ML] Fix incorrect logging of unexpected model size error (elastic#81089)
  [ML] Make inference timeout test more reliable (elastic#81094)
  ...
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Nov 30, 2021
* upstream/master: (55 commits)
  Fix ComposableIndexTemplate equals when composed_of is null (elastic#80864)
  Optimize DLS bitset building for matchAll query (elastic#81030)
  URL option for BaseRunAsSuperuserCommand (elastic#81025)
  Less Verbose Serialization of Snapshot Failure in SLM Metadata (elastic#80942)
  Fix shadowed vars pt7 (elastic#80996)
  Fail shards early when we can detect a type missmatch (elastic#79869)
  Delegate Ref Counting to ByteBuf in Netty Transport (elastic#81096)
  Clarify `unassigned.reason` docs (elastic#81017)
  Strip blocks from settings for reindex targets (elastic#80887)
  Split off the values supplier for ScriptDocValues (elastic#80635)
  [ML] Switch message and detail for model snapshot deprecations (elastic#81108)
  [DOCS] Update xrefs for snapshot restore docs (elastic#81023)
  [ML] Updates visiblity of validate API (elastic#81061)
  Track histogram of transport handling times (elastic#80581)
  [ML] Fix datafeed preview with remote indices (elastic#81099)
  [ML] Fix acceptable model snapshot versions in ML deprecation checker (elastic#81060)
  [ML] Add logging for failing PyTorch test (elastic#81044)
  Extending the timeout waiting for snapshot to be ready (elastic#81018)
  [ML] Fix incorrect logging of unexpected model size error (elastic#81089)
  [ML] Make inference timeout test more reliable (elastic#81094)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.0.0 v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants