Skip to content

Conversation

@thecoop
Copy link
Member

@thecoop thecoop commented Jan 19, 2023

Migrate files in org.elasticsearch.search to use TransportVersion

All changes are s/Version/TransportVersion/, but see comments

@thecoop thecoop force-pushed the transportversion-search branch from c1a0df4 to 64aa21a Compare January 19, 2023 16:03
throw new IllegalArgumentException(
"Versions before 8.7.0 don't support multiple [knn] search clauses and search was sent to ["
+ out.getVersion()
"Versions before 8070099 don't support multiple [knn] search clauses and search was sent to ["
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to keep Version here?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want Version, it wouldn't make sense. However, this exception seems odd. It looks like some validation that should have happened before we are trying to serialize results. Perhaps someone from the Search area can clarify why such validation is happening so late.

Copy link
Member Author

Choose a reason for hiding this comment

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

@benwtrent What is the exception here needed for?

Copy link
Member

Choose a reason for hiding this comment

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

This is the exact same validation that occurs up in SearchSourceBuilder. We cannot allow serializing this to older nodes if there are more than one KNN search results. Similarly, we don't allow search source builder to serialize to older nodes if it has more than one KNN search clause.

I fail to see how this is a problem here, but NOT a problem in the SearchSourceBuilder.

Copy link
Member

Choose a reason for hiding this comment

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

It's not a problem, it's more a question on the importance of the message containing the actual self managed node version, vs an opaque version for the transport protocol. What I find odd here is this error being thrown as an IllegalArgumentException, which will go back to users as a 400 http response. Normally such errors should be checked long before we are serializing results.

Copy link
Member Author

Choose a reason for hiding this comment

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

If this is only a stopgap exception aimed at developers only, then we can leave it as the transport version

Copy link
Member

Choose a reason for hiding this comment

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

If this is only a stopgap exception aimed at developers only, then we can leave it as the transport version

Non-administrators wouldn't care about this exception, exactly. Administrators or folks debugging failures will care.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think a problem of identifying a "code version running" is not only limited to this one exception here. We will have to have some kind of system with a matrix of transport version - commit/onprem version.

Perhaps for this case specifically we change this as per @benwtrent suggestion. "Cannot serialize multiple KNN results to older node with transport version:" or similar (the 'older node' feels strange)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created #93387 to check exception messages now using transport version

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the exception message

@thecoop thecoop marked this pull request as ready for review January 24, 2023 10:36
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Jan 24, 2023
@thecoop thecoop marked this pull request as draft January 24, 2023 10:48
@thecoop thecoop marked this pull request as ready for review January 24, 2023 14:29
@thecoop thecoop requested a review from rjernst January 31, 2023 09:36
@thecoop thecoop requested a review from pgomulka January 31, 2023 13:20
@thecoop
Copy link
Member Author

thecoop commented Jan 31, 2023

@elasticsearchmachine rerun elasticsearch-ci/part-1

Copy link
Contributor

@pgomulka pgomulka left a comment

Choose a reason for hiding this comment

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

LGTM

@thecoop thecoop merged commit 99018d9 into elastic:main Feb 1, 2023
@thecoop thecoop deleted the transportversion-search branch February 1, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Transport API Transport client API >refactoring Team:Core/Infra Meta label for core/infra team v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants