Skip to content

Using the STREAMS_LOGS_SUPPORT_8_19 transport version#129796

Merged
lukewhiting merged 5 commits intoelastic:mainfrom
masseyke:use-streams_logs_support_8_19
Jun 23, 2025
Merged

Using the STREAMS_LOGS_SUPPORT_8_19 transport version#129796
lukewhiting merged 5 commits intoelastic:mainfrom
masseyke:use-streams_logs_support_8_19

Conversation

@masseyke
Copy link
Copy Markdown
Member

This follows #129753, using the transport version it introduced.

@masseyke masseyke added >non-issue :StorageEngine/Data streams Data streams and their lifecycles v9.1.0 labels Jun 20, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Jun 20, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

Returning null from getMinimalSupportedVersion
@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.STREAMS_LOGS_SUPPORT;
return null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure that it's safe to return null here? It has a few callers outside of the default implementation of supportsVersion(), including in AbstractNamedDiffable.diff() (directly or indirectly, on both code paths).

I see a couple of different patterns elsewhere in the codebase where supportVersion() is overridden.

  • MinimalServiceSettings.supportsVersion and ModelRegistryMetadata have the same logic to what you have here, and getMinimalSupportedVersion() returns the _8_19 version.
  • AggregateMetricDoubleBlockBuilder, NoneChunkingSetting, and PinnedRankDoc make this method, e.g. the first of those does throw new UnsupportedOperationException("must not be called when overriding supportsVersion").
    (There's also TimeSeriesSourceOperator.Status where the two methods don't seem to agree on the minimal version, I haven't looked properly at that.)

If we're sure this method will never be called, I would prefer to throw an exception with an explicit message like e.g. AggregateMetricDoubleBlockBuilder does, so that if we're wrong we'll get something more helpful than an NPE somewhere later on. I don't know whether that or returning the _8_19 version is safer.

Hopefully someone from Core/Infra can sort us out here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We tried throwing an exception originally but it causes the tests to fail too. It seems returning TransportVersions.STREAMS_LOGS_SUPPORT_8_19 fixes the test fails so that looks to be like it's the right path possibly?

Copy link
Copy Markdown
Member

@PeteGillinElastic PeteGillinElastic Jun 23, 2025

Choose a reason for hiding this comment

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

Since there is a precedent for doing it, it fixes the tests, let's maybe go with this and see what Core/Infra have to say.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW, I'm throwing an exception in this somewhat related PR, and that works fine.

Copy link
Copy Markdown
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.

In addition to my question above, there are some test failures which appear related to this PR: TestToggleIT.testLogStreamToggle, and a YAML REST test Basic toggle of logs state enable to disable and back.

Copy link
Copy Markdown
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.

The change looks fine.

If this weren't an 8.19 transport version we'd need to be mega sure we didn't cut a serverless release with the version. But serverless won't need the version anyway - it'll always be onOrAfter(STREAMS_LOGS_SUPPORT) because it's based off of main.

@lukewhiting lukewhiting enabled auto-merge (squash) June 23, 2025 13:40
@lukewhiting lukewhiting merged commit 2f3b2b3 into elastic:main Jun 23, 2025
32 checks passed
@masseyke masseyke deleted the use-streams_logs_support_8_19 branch June 23, 2025 14:38
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 25, 2025
* Using the STREAMS_LOGS_SUPPORT_8_19 transport version

* Update StreamsMetadata.java

Returning null from getMinimalSupportedVersion

* Return minimal supported version as 8.19 for metadata object to fix test fail

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/Data streams Data streams and their lifecycles Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants