Support OpenSearch 2.0 in .net client#51
Conversation
a88e99b
There was a problem hiding this comment.
The master/cluster manager change looks suspicious. The external API should not have changed without a major version bump and a prior deprecation, so any time we removed "master" in this code, we probably needed to mark it deprecated and call into its manager version. Then we have different enums and state values where renaming one into the other is probably similarly broken (we probably shouldn't keep the state of both master and cluster_manager, but I am not sure).
| return this; | ||
| } | ||
|
|
||
| public VirtualCluster MasterEligible(params int[] ports) |
There was a problem hiding this comment.
This would be a breaking change, I think you need both Master and ClusterManager versions, and tests to ensure we catch such. There's probably other similar instances.
There was a problem hiding this comment.
Good point. VirtualizedCluster is used by unit tests only, but users re-use code from it or from tests in their application.
Proposed fix - recover MasterEligible and call ClusterManagerEligible inside; add deprecation notice.
There was a problem hiding this comment.
@dblock,
please see fix in Bit-Quill#38.
dblock
left a comment
There was a problem hiding this comment.
There are more instances where I think the obsolete method should be calling the non-obsolete one and be marked as such. I am not 100% sure though, I think it does work without one calling the other.
| public ClusterGetSettingsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); | ||
| ///<summary>Explicit operation timeout for connection to cluster_manager node</summary> | ||
| ///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks> | ||
| public ClusterGetSettingsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); |
There was a problem hiding this comment.
Should MasterTimeout call ClusterManagerTimeout and be deprecated with @Obsolete?
There was a problem hiding this comment.
I didn't use here Obsolete attribute, because this is not obsolete for OpenSearch 1.x. This could fail build for users.
I don't call MasterTimeout in ClusterManagerTimeout, because these methods set different parameters. Imaging you are working with OpenSearch 1.2 and setting MasterTimeout. If it sets cluster_manager_timeout under the hood, server won't recognize it.
We can call MasterTimeout in ClusterManagerTimeout in addition to setting cluster_manager_timeout, but I think it is odd.
This is applicable for all instances of ClusterManagerTimeout (a lots of them).
13bf5d4
dblock
left a comment
There was a problem hiding this comment.
This is great! I think the one thing missing is incrementing the client version to 1.1. If I am not mistaken, semantically this version has a new feature (support for OpenSearch 2.x) and doesn't contain any breaking changes, so it shouldn't be 2.0, but 1.1.
COMPATIBILITY.md
Outdated
| | 1.3.2 | 1.0.0 | | ||
| | 1.3.3 | 1.0.0 | | ||
| | 2.0.0 | 1.0.0 | | ||
| | 2.0.1 | 1.0.0 | |
There was a problem hiding this comment.
I think we should update the compatibility matrix to say that client 1.0 is compatible with OpenSearch 1.x, and client 1.1 is compatible with OpenSearch 1.x and 2.x.
There was a problem hiding this comment.
Agree, if 1.x means literally 1.x. I asked in inital PR to use 1.x/2.x instead of listing out all versions, it's easier to read.
The next client version should be 1.1 since there are no breaking changes, so maybe this? Users are likely to be already using some version of OpenSearch. They can lookup what are the compatible client versions, instead of the other way around.
| OpenSearch Version | Client Version |
|--------------------|----------------|
| 1.x | 1.0.0, 1.1.0 |
| 2.x | 1.1.0 |
There was a problem hiding this comment.
You could reverse the columns making it easier to grok ;)
234b745
571669b to
234b745
Compare
|
@dblock do you mind having a look at this again? Rebasing dismissed existing reviews. |
wbeckler
left a comment
There was a problem hiding this comment.
LGTM given there were two reviewers okay already.
Description
search.remotesettings._typevalidation in mapping APIs as it was removed from OpenSearch.segmentsstats.masterreferences tocluster_managercomply with OpenSearch 2.0indices.exists_type/TypeExistsAPIs as deprecatedinclude_type_name/IncludeTypeNamemaster_timeouttocluster_manager_timeoutcluster_manageras it was done in OpenSearch.CatMaster*API was duplicated intoCatClusterManager*, butCatMaster*wasn't deleted. This provide backward compatibility. No new functionality added.Issues Resolved
#34
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.