-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] version number is incompatible with existing ES clients #693
Comments
Since the problem is only with the
For example:
There is probably a property name to use rather than "opensearchVersion." But, the advantage of this solution is that callers can know the ElasticSearch API version and the actual OpenSearch version (if that matters to the client). |
Doesn't feel right that we're retaining ES number anywhere. Are we saying that we don't want clients to have to modify anything to work against OpenSearch? Won't clients want to assert compatibility with OpenSearch 1.0? |
Yes, I believe that clients should not have to make changes to migrate from ElasticSearch 7.10.2 to OpenSearch 1.0. We've already found that Logstash with the Logstash ES plugin can work with OpenSearch if we manually change The introduction blog post also indicates this is the case.
Clients could assert compatibility with OpenSearch by using the new Additionally, the solution I proposed above may serve as a stepping stone from OpenSearch 1.x to 2.x. The change allows existing clients to work with OpenSearch 1.x without modifications (assuming other APIs are still compatible). Clients and libraries could eventually move to support OpenSearch only, or attempt to support both ElasticSearch and OpenSearch by utilizing the For example, clients could start to write code along these lines. It would be compatible with the suggestions above and would continue to work if
|
I am 💯 with you on backward compatibility, but OpenSearch didn't break backward compatibility by changing the value of Someone here will definitely get to #667 in order, but don't let them beat you to it :) |
@dlvenable raises a great point that this is almost certainly going to be more than a logstash issue: a lot of clients that interact with OpenSearch are going to check the version # to know the wire protocol to use. The proposed solution seems really elegant: keep version.number at 7.10.2 which reflects the API compatibility and lets current clients work without changing, and have a separate openSearchVersion identifier for new clients. |
@jcgraybill I think I agree, but I do worry that this could lead to users having broken software more often as a production surprise. Either way, we need to contribute integration tests against OpenSearch to https://github.com/logstash-plugins/logstash-output-elasticsearch. It currently runs against multiple versions of ES. |
@dblock , Thanks for engaging on this. I'm unsure exactly what issues you might be imagining. Are they problems with automated tools expecting specific behavior from specific versions? Or more of a human-related issue? With the latter, I could see an issue with logging. Code like It is likely a fair assumption that automated clients which parse the version mostly care about the major version, and maybe sometimes care about the minor version. The patch version is probably ignored. Perhaps OpenSearch could have an alternate patch value? Some possible ideas are:
Now that log line about could read |
Let's be careful not to engineer a ton of cosmetic surgery just to treat a secondary symptom. Doing so risks causing other problems. First things first, the backwards compatibility tests are still disabled; so we absolutely need to re-enable those in order to catch any/all other areas affected by the version rebase. (/cc @harold-wang) That's being worked now. As for this particular symptom, the root cause is similar to the "opensearch node fails to join" issue - /cc @shwetathareja. In short, since the server side transport layer is "version aware" of the client we can detect what version of the client is attempting to connect and "mask" the OpenSearch version to predecessor 7.10.2 appropriately. This is why we've been super thoughtful to have the 1.0.0 release not introduce any breaking changes from 7.10.2. |
There is already a patch value in the semantic versioning system. (e.g., 1.0.0 is the 0 patch version of Major 1, Minor 0 release). Are you suggesting a "feature" or "nightly" number? This has been brought up before (in the context of plugins) and I think it's worth discussing as a separate topic independent of this particular bug because I think it has merit. Would you like to open a separate discuss issue? |
@nknize , The issue you referenced for "OpenSearch node fails to join" mentions a "backward compatibility mode" solution. Is the idea that OpenSearch would report Regarding the patch idea, this was an extension of my original proposal. Rather than returning
|
To elaborate on the purpose of this bug, we found that Logstash and Filebeats both fail to load templates when running against OpenSearch 1.0.0. In local experiments, we modified MainResponse to return a hardcoded value:
After this change, Logstash and Filebeats can run against OpenSearch. It does appear that this is the cause of #706 as well. I did not create the exact setup that author included. However, both of us saw this same error in OpenSearch 1.0.0.
Again, that manual change to MainResponse was sufficient to get past the error. |
Just chiming in to say thanks, and this worked in our testing. #706 (comment) |
No. I'm saying use the versioning system as it is intended (for backward compatibility) and fix MainResponse to return the predecessor version for Legacy Clients which wasn't covered in the initial patch that adds the
No hardcoded values. It should be based on the client version. But as I mentioned, I wouldn't treat this symptom just yet while Backwards Compatibility testing is disabled. This could be "patching" one issue and causing another. This "fix" I'm suggesting is on hold until we can smoke test w/ bwc tests enabled. |
@harold-wang or @nknize, are you working on this? |
First PR opened |
@nknize , As I understand PR #708, this will support the internal node-to-node communication inside an ElasticSearch cluster. I created this ticket mostly to support external clients. Also, #667 and #706 relate to Logstash and Filebeats. How would ElasticSearch determine the client version in order to change the reported version number? |
Let's not overthink this hack. It's a stopgap solution for 1.0+ forward compatibility with existing legacy clients to prevent users from having to mass upgrade.
It's not necessary but what your suggesting isn't a bad idea to spoof
Yes. This approach is a forward compatibility hack for MainResponse content until a compatibility module can do this "correctly". I would suggest that compatibility module provide an endpoint to return the spoofed version information instead of
If OpenSearch sticks with Elastic clients then compatibility going forward is an unknown. Case in point: the new java client which Elastic intends to replace the existing Java High Level rest client. At some point here (preferably before 2.0) OpenSearch will be forced to fork the clients to ensure compatibility with a diverging core.
Rolling upgrades are required to deploy OpenSearch anyway. |
Assigned to @mch2 |
Put up a draft here for some initial comments |
Hi, do we have any idea when we will have this released?
And when logstash started, still report below errors:
Logstash image: |
@liangxibing Hi Simon -- PR 814 wasn't ready in time to make this release, so we cut it without it. Once it's merged, we'll figure out how to get it a bundle out that includes it, preferably before GA. I'm anxious to see it out, too! /C |
The upcoming change should certainly help allow easy migration to using OpenSearch with existing clients. I also want to bring up the topic of how compatibility will be expressed going forward. Once an ES administrator flips the switch off, clients will need to examine at the For example, clients will need to know OpenSearch 1.0 is compatible with ElasticSearch 7.10, OpenSearch 2.0 is compatible with ElasticSearch 8.0 (hypothetically), OpenSearch 3.0 is compatible with ElasticSearch 8.5 (again, hypothetical), or whatever it is. I'm hoping to open the discussion on how what support OpenSearch should provide for advertising ElasticSearch compatibility with clients. OpenSearch could make it easier for clients to know which ElasticSearch version the current OpenSearch version is compatible with. One possible solution is adding a new property named For example,
This can make it much easier for clients to support both ElasticSearch and OpenSearch going forward. I think one big question is whether OpenSearch will retain compatibility with ElasticSearch or not. If not, then something like this makes little sense. But if so, then this could be a good way to encourage clients to write code for both ElasticSearch and OpenSearch. |
OpenSearch is derived from Elasticsearch. It's a fork at 7.10.2, so it's only compatible with ES until then. I expect ES to diverge. Clients can decide whether they want to support OpenSearch or ES, or both. We tried to answer some of these questions in the upgrading FAQ. If we didn't do a good job, maybe bring more questions up? Try to answer them in a PR and we can discuss! |
Thank you for clarifying on the current expectations for compatibility. |
@dblock FAQ link is broken |
Looks like the website had a snafu overnight, opensearch-project/project-website#126 (comment) |
@dblock , @nknize With the merge of #847 , if the setting is activated, then clients should get this:
I believe that we want our clients to write code that can support all of these possibilities: ElasticSearch 7, OpenSearch 1 with version compatibility, and OpenSearch 1 without version compatibility. This helps with the migration path to OpenSearch 1 without version compatibility. Currently, when in version compatibility mode, the client will have to add some short-term hack that also assumes OpenSearch 7 is the same as OpenSearch 1. Clients can write cleaner, more-robust code if we just remove the |
I see your point @dlvenable, we're going to have a problem when we release OpenSearch 7.10.2. I am tempted to say that we should remove |
I think by the time OpenSearch 7.10.2 is released there will be a long tail divergence from the Elasticsearch codebase that this "compatibility" issue will be a distant memory. But this is a good point. The |
I opened #880 |
Yes, because ElasticSearch does not have the |
Are you going to release a new RC in July with the fix? My team can't use filebeat in production |
A cluster setting was introduced in #847. We removed the distribution in backwards-compatible mode in #898. Set I am going to close this because the code is done. I added an issue to document it in opensearch-project/documentation-website#72. |
This will be in 1.0 GA, shortly. |
Describe the bug
The API which provides version includes a field
version.number
. Clients parse this value to determine what version of ElasticSearch is running, and is used for checking API compatibility.In ElasticSearch 7.10, this value is reported as
7.10
.In OpenSearch 1.0.0, the value is
1.0.0-SNAPSHOT
.Existing clients which parse this string are unable to communicate with OpenSearch when they rely on the value of the version.
To Reproduce
Steps to reproduce the behavior:
curl http://localhost:9200
version.number
.curl http://localhost:9200
version.number
.Expected behavior
Because OpenSearch uses the same API as ElasticSearch 7.10.2, the value of
version.number
should be7.10.2
.Expected:
Actual:
Plugins
N/A
Screenshots
N/A
Host/Environment (please complete the following information):
N/A
Additional context
We confirmed that this is the cause of #667. It also appears that this may be causing #669.
The text was updated successfully, but these errors were encountered: