Skip to content

Conversation

@nielsbauman
Copy link
Contributor

This is part of the work to make DLM project-aware.

These two features were pretty tightly coupled, so I saved some effort by combining them in one PR.

This is part of the work to make DLM project-aware.

These two features were pretty tightly coupled, so I saved some effort
by combining them in one PR.
@nielsbauman nielsbauman added >non-issue :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v9.1.0 labels Mar 13, 2025
@nielsbauman nielsbauman requested a review from a team March 13, 2025 20:14
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

for (String indexName : errorStore.getAllIndices()) {
final var projectId = metadata.getProject().id();
for (String indexName : errorStore.getAllIndices(projectId)) {
IndexAbstraction indexAbstraction = metadata.getProject().getIndicesLookup().get(indexName);
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
IndexAbstraction indexAbstraction = metadata.getProject().getIndicesLookup().get(indexName);
IndexAbstraction indexAbstraction = metadata.getProject(projectId).getIndicesLookup().get(indexName);

to keep deprecation in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already have local changes ready to make DataStreamLifecycleService project aware - overriding these changes. So I'll leave this as is for now.

Comment on lines +1341 to +1342
@FixForMultiProject(description = "Don't use default project ID")
final var projectId = Metadata.DEFAULT_PROJECT_ID;
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR. But I wonder whether we could remove Metadata.DEFAULT_PROJECT_ID and replace it with a deprecated method, e.g.:

@Deprecated(forRemoval=true)
public static ProjectId defaultProjectId() {
    return ProjectId.DEFAULT;
}

We can then use the above method in all places where default project id is meant to be a placeholder. And use ProjectId.DEFAULT for places we actually want the default ID. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's a great idea, we should have done that earlier :)

@nielsbauman nielsbauman enabled auto-merge (squash) March 19, 2025 09:07
@nielsbauman nielsbauman merged commit 8e64f50 into elastic:main Mar 19, 2025
17 checks passed
@nielsbauman nielsbauman deleted the mp-error-stats branch March 19, 2025 10:39
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
This is part of the work to make DLM project-aware.

These two features were pretty tightly coupled, so I saved some effort
by combining them in one PR.
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
This is part of the work to make DLM project-aware.

These two features were pretty tightly coupled, so I saved some effort
by combining them in one PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants