Only report bug warning in precise conditions.#7772
Conversation
|
|
||
| if ((exist && !template.isPresent()) || (!exist && template.isPresent())) { | ||
| throw new Error("[Bug warning]ElasticSearch client query template result is not consistent. Please file an issue to Apache SkyWalking.(https://github.com/apache/skywalking/issues)"); | ||
| if ((templateExists && !template.isPresent()) || (!templateExists && template.isPresent())) { |
There was a problem hiding this comment.
If this is the only condition, I think a basic test should cover it, this is a very basic logic and should be discovered at test phase, not runtime
assertThat(templateClient.exists(name)).isTrue();There was a problem hiding this comment.
I was proposing this due to we can't test all server versions, and as we are not official, we can't tell when breaking change happens.
This exception codes should never be executed.
There was a problem hiding this comment.
The current conditions checking could fail in daily used, it is not a bug, and we have to suffer endless question and bug report on GitHub.
There was a problem hiding this comment.
The current conditions checking could fail in daily used, it is not a bug, and we have to suffer endless question and bug report on GitHub.
I don't mean to keep the current conditions, I mean if the condition is to be if ((templateExists && !template.isPresent()) || (!templateExists && template.isPresent())), then this is a very basic function that we should test in the perspective of ES client.
I was proposing this due to we can't test all server versions, and as we are not official, we can't tell when breaking change happens.
The supported versions are fixed and the codes won't run on un-tested versions.
We will manually test a new ES version, and add it into our supported list, otherwise if users run on a future ES server for example 8.2, the OAP won't even start
There was a problem hiding this comment.
It's good to me to keep the new condition, but please also add a test to
assertThat(templateClient.exists(name)).isTrue();There was a problem hiding this comment.
The supported versions are fixed and the codes won't run on un-tested versions.
I know we have {"6.3.2"}, {"7.4.2"}, {"7.8.0"}, {"7.10.2"}, but who knows one day, something breaks unexpected, such as we never knew in the 7.x there are different cases.
It's good to me to keep the new condition, but please also add a test to
Added check for template existing check.
CHANGESlog.User will see the
[Bug warning]in 2 typical casescreatemethod will fix this.