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

[TEST] Fix staleness in fetching component templates #93321

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

grcevski
Copy link
Contributor

@grcevski grcevski commented Jan 27, 2023

Result from the API call seems behind the most recent state. This change changes how we fetch the templates to ensure we use the most recent metadata version.

Based on the server logs we did write the index and component templates as we should've, but the API call made doesn't find them occasionally. I believe this is because the state hasn't propagated fully so we should retry the API call for a bit.

From the logs:

1> [2023-01-27T05:25:15,717][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding component template [runtime_component_template] |  
-- | --
  | 1> [2023-01-27T05:25:15,718][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding component template [component_template1] |  
  | 1> [2023-01-27T05:25:15,720][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding component template [other_component_template] |  
  | 1> [2023-01-27T05:25:15,722][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding index template [template_other] for index patterns [foo*, mar*] |  
  | 1> [2023-01-27T05:25:15,725][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding index template [template_2] for index patterns [foo*, mar*] |  
  | 1> [2023-01-27T05:25:15,727][INFO ][o.e.c.m.MetadataIndexTemplateService] [node_t1] adding index template [template_1] for index patterns [te*, bar*]

Closes #93202

Result from the API call seems behind the most
recent state. This change adds a retry of the
call to ensure we fetch the most recent state.
@grcevski grcevski added :Core/Infra/Core Core issues without another label >test-failure Triaged test failures from CI Team:Core/Infra Meta label for core/infra team auto-backport-and-merge Automatically create backport pull requests and merge when ready v8.7.0 v8.6.2 labels Jan 27, 2023
@elasticsearchmachine
Copy link
Collaborator

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

response.indexTemplates().keySet().stream().collect(Collectors.toSet()),
containsInAnyOrder("template_1", "template_2", "template_other")
);
}, 60L, TimeUnit.SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

From direct conversation: Can we wait for the appropriate metadata version? The issue, as ya mentioned in conversation, is GetComposableIndexTemplate may be stale.

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the test, nice job.

@grcevski grcevski changed the title [TEST] Retry fetching component templates [TEST] Fix staleness in fetching component templates Jan 31, 2023
@grcevski grcevski merged commit 37f195e into elastic:main Jan 31, 2023
@grcevski
Copy link
Contributor Author

Thanks Stu!

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-and-merge Automatically create backport pull requests and merge when ready :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test-failure Triaged test failures from CI v8.6.2 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] ComponentTemplatesFileSettingsIT testSettingsApplied failing
3 participants