Skip to content

Introduce flag for testing CCS compatibility #81809

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

Merged
merged 50 commits into from
Jan 27, 2022

Conversation

cbuescher
Copy link
Member

@cbuescher cbuescher commented Dec 16, 2021

CCS works with a subset of APIs and features depending on the versions of the clusters being communicated with.
Currently we limit this CCS compliance to one minor version backward and one minor forward.

This change adds a setting useful for testing in clients like Kibana that can be turned on to check if a search request
sent to one of the endpoints that are supporting CCS is compatible with a cluster that is on one minor version back.
We do this by trying to serialize the request to a stream with the earlier version. Features and components that are
not supported in that version should throw errors upon atempted serialization to indicate they are not compatible.
In addition we need components extending NamedWriteable (e.g. new queries) to also error when they are written to a
stream that has a version before the version they were released.

CCS works with a subset of APIs and features depending on the versions of the clusters being communicated with.
Currently we limit this CCS compliance to one minor version backward and one minor
forward. This change adds a flag that can be turned on to test if a request sent
to one of the endpoints that are supporting CCS is serializable to a cluster
that is on one minor version backward. We do this by trying to serialize the
request to a steam with that earlier version. Features and components that are
not supported in that version should throw errors upon atempted serialization to
indicate they are not compatible with that version. In addition we need
components extending NamedWriteable (e.g. new queries) to also error when they are written to a
stream that has a version before the version they are released in.
@cbuescher
Copy link
Member Author

Caveat: I didn't add checks to the QL rest endpoints and the Vector tile search search yet, althought they are mentioned in the supported APIs because I want to discuss with the respective teams first.

@cbuescher cbuescher requested a review from jimczi December 16, 2021 11:48
Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

I did a first pass and left some comments. The approach looks correct to me.

@javanna javanna removed the request for review from jimczi January 18, 2022 09:45
@cbuescher cbuescher changed the title WIP: Introduce flag for testing CCS compatibility Introduce flag for testing CCS compatibility Jan 18, 2022
@cbuescher cbuescher added :Search/Search Search-related issues that do not fall into other categories and removed WIP labels Jan 18, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jan 18, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@cbuescher cbuescher merged commit 051e1d6 into elastic:master Jan 27, 2022
@cbuescher
Copy link
Member Author

Heads up to @elastic/kibana-operations and @stacey-gammon that this PR is merged now and starting with 8.1 you should be able to set the 'search.check_ccs_compatibility' setting in the config of a test cluster to enable the CCS compatibility checks on the coordinating node. Since we had no new features added since 8.0 we don't espect any errors when the setting is activated, please let us know if you have questions or once you start using this for testing.

cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Feb 1, 2022
In elastic#81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.
This change moves ScoreFunctionBuilders which are used in function score queries
under that interface. Since all these builders have been around before 7.0 we
return the empty version constant for them.
cbuescher pushed a commit that referenced this pull request Feb 1, 2022
In #81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.
This change moves ScoreFunctionBuilders which are used in function score queries
under that interface. Since all these builders have been around before 7.0 we
return the empty version constant for them.
cbuescher pushed a commit that referenced this pull request Feb 3, 2022
Supporting #81809, we changed query builders to implement 'VersionedNamedWriteable' to be able to detect
when new query builders under the search enpoint are introduced and also to force new implementations to overwrite
'getMinimalSupportedVersion' with a current release version.
This change removes the default implementation in the QueryBuilder interface and replaces it with individual
implementations in the currently existing query builders. For builders that have been around for longer than 7.0 (the
earliest verison constant we currently have around) we use Version.V_EMPTY which sorts always before any other declared version.
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Feb 7, 2022
In elastic#81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.

This change moves aggregation builders under that interface. Most builders
have been around long before version 7.0, so we return an empty version tag for them.
The newer ones return the version they were first released in.
cbuescher pushed a commit that referenced this pull request Feb 8, 2022
In #81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.

This change moves aggregation builders under that interface. Most builders
have been around long before version 7.0, so we return an empty version tag for them.
The newer ones return the version they were first released in.
cbuescher pushed a commit that referenced this pull request Feb 9, 2022
In #81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.

This change moves pipeline aggregation builders under that interface. Most builders
have been around long before version 7.0, so we return an empty version tag for them.
The newer ones return the version they were first released in.
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Feb 16, 2022
In elastic#81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.

This change moves the InferenceConfigUpdate and implementing classes under that
sub-interface. I have used the versions they were first released in
looking at the pull requests that introduced the classes.
cbuescher pushed a commit that referenced this pull request Feb 16, 2022
In #81809 we introduced a mechanism to check searializability of search request
to earlier version nodes already on the coordinating node. This requires
knowledge about the version that NamedWritable classes have been introduced,
which is why we started moving classes that are used inside the search request
under the VersionedNamedWriteable interface to make sure future additions
implement the mthod that provides the version information.

This change moves the InferenceConfigUpdate and implementing classes under that
sub-interface. I have used the versions they were first released in
looking at the pull requests that introduced the classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants