-
Notifications
You must be signed in to change notification settings - Fork 49
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
Support OpenSearch 2.0 in .net client #51
Conversation
a88e99b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
@@ -69,10 +69,10 @@ public VirtualCluster PublishAddress(string publishHost) | |||
return this; | |||
} | |||
|
|||
public VirtualCluster MasterEligible(params int[] ports) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblock,
please see fix in Bit-Quill#38.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged in 2d6cff5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should MasterTimeout
call ClusterManagerTimeout
and be deprecated with @Obsolete
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, you're absolutely right.
13bf5d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could reverse the columns making it easier to grok ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated in 0d58b5b.
234b745
571669b
to
234b745
Compare
@dblock do you mind having a look at this again? Rebasing dismissed existing reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given there were two reviewers okay already.
Description
search.remote
settings._type
validation in mapping APIs as it was removed from OpenSearch.segments
stats.master
references tocluster_manager
comply with OpenSearch 2.0indices.exists_type
/TypeExists
APIs as deprecatedinclude_type_name
/IncludeTypeName
master_timeout
tocluster_manager_timeout
cluster_manager
as 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.