Skip to content

Conversation

lukewhiting
Copy link
Contributor

Backport of #129474. Currently blocked by #129796.

Thanks to @masseyke for 99.9% of the leg work on this with #129798

* Enable And Disable Endpoint

* Status Endpoint

* Integration Tests

* REST Spec

* REST Spec tests

* Some documentation

* Update docs/changelog/129474.yaml

* Fix failing security test

* PR Fixes

* PR Fixes - Add missing feature flag name to YAML spec

* PR Fixes - Fix support for timeout and master_timeout parameters

* PR Fixes - Make the REST handler validation happy with the new params

* Delete docs/changelog/129474.yaml

* PR Fixes - Switch to local metadata action type and improve request handling

* PR Fixes - Make enable / disable endpoint cancellable

* PR Fixes - Switch timeout param name for status endpoint

* PR Fixes - Switch timeout param name for status endpoint in spec

* PR Fixes - Enforce local only use for status action

* PR Fixes - Refactor StreamsMetadata into server

* PR Fixes - Add streams module to multi project YAML test suite

* PR Fixes - Add streams cluster module to multi project YAML test suite
@lukewhiting lukewhiting requested a review from Copilot June 23, 2025 09:01
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v8.19.0 labels Jun 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR backports new functionality to support enabling, disabling, and querying the status of logs streams. Key changes include the introduction of the StreamsMetadata for storing logs state, new REST and transport actions for toggling and retrieving log streams status, and corresponding tests and API spec updates.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java Adds necessary privilege constants for the new streams endpoints
server/src/main/java/org/elasticsearch/cluster/metadata/StreamsMetadata.java Introduces the streams metadata to track logs state
server/src/main/java/org/elasticsearch/cluster/ClusterModule.java and TransportVersions.java Registers the streams metadata and adds a new transport version constant
rest-api-spec/* Defines new API endpoints for logs stream enable, disable, and status operations
modules/streams/src/main/java/org/elasticsearch/rest/streams/logs/* Implements the REST and transport actions for streams status and logs toggling
modules/streams/* Adds tests, plugin support, and build configurations for the streams feature


@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.STREAMS_LOGS_SUPPORT_8_19;
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 assume this is OK as although this isn't technically true (9.0.x nodes aren't supported), we won't allow 9.0 nodes to join a 8.19 cluster?

Copy link
Member

Choose a reason for hiding this comment

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

I mean, technically it is true that the _8_19 version is the minimal supported one — what's not true is that all higher versions support it. In other words, it's the default supportsVersion() which is technically not telling the truth. But, as you say, this should probably be okay?

Copy link
Member

Choose a reason for hiding this comment

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

My understanding of getMinimalSupportedVersion is that we will send this to 9.0 node with this change - but that's fine because 8.19 isn't compatible with 9.0 at all - needs 9.1. We have all kinds of wire incompatibilities between 8.19 and 9.0 already.

So is this true? From a certain point of view.
image

Maybe you'd best leave a comment saying this so folks reading won't be confused. It's possible that in a year we'll have forgotten this weird version problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically Correct

Fair enough :-) I have added a comment for future lost souls to take comfort in

@lukewhiting lukewhiting added backport :Data Management/Data streams Data streams and their lifecycles labels Jun 23, 2025
@PeteGillinElastic PeteGillinElastic removed the needs:triage Requires assignment of a team area label label Jun 23, 2025
Copy link
Member

@PeteGillinElastic PeteGillinElastic left a comment

Choose a reason for hiding this comment

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

Is this a clean backport apart from the transport version stuff? If so, this LGTM, but once again let's have Core/Infra confirm we're doing the write thing there.


@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.STREAMS_LOGS_SUPPORT_8_19;
Copy link
Member

Choose a reason for hiding this comment

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

I mean, technically it is true that the _8_19 version is the minimal supported one — what's not true is that all higher versions support it. In other words, it's the default supportsVersion() which is technically not telling the truth. But, as you say, this should probably be okay?

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

Transport version dance looks right to me. I can't approve the rest, but y'all have that covered.


@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.STREAMS_LOGS_SUPPORT_8_19;
Copy link
Member

Choose a reason for hiding this comment

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

My understanding of getMinimalSupportedVersion is that we will send this to 9.0 node with this change - but that's fine because 8.19 isn't compatible with 9.0 at all - needs 9.1. We have all kinds of wire incompatibilities between 8.19 and 9.0 already.

So is this true? From a certain point of view.
image

Maybe you'd best leave a comment saying this so folks reading won't be confused. It's possible that in a year we'll have forgotten this weird version problem.

@lukewhiting lukewhiting merged commit 7ea565a into elastic:8.19 Jun 23, 2025
22 checks passed
@lukewhiting lukewhiting deleted the backport/8.19/pr-129474 branch June 24, 2025 09:25
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.

5 participants