-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Enhance MetricsEsDAO#multiGet to avoid OutOfBounds #5096
Conversation
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.
@kezhenxu94 @dmsolr Would you take a look at ES API?
Seems like response.getHits().getTotalHits().value
VS response.getHits().getHits().length
. @amwyyyy A little explanation about the difference?
Codecov Report
@@ Coverage Diff @@
## master #5096 +/- ##
============================================
- Coverage 53.09% 53.01% -0.08%
- Complexity 2985 2986 +1
============================================
Files 1417 1417
Lines 30719 30714 -5
Branches 3417 3418 +1
============================================
- Hits 16310 16283 -27
- Misses 13605 13626 +21
- Partials 804 805 +1 Continue to review full report at Codecov.
|
In actually,
|
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
Notice, this still could cause duplicate raws in different index. This should be clear. |
Because timeout still could happen, then duplicate records generated. |
See this issues #5039
The problem is because the es query times out
Cause duplicate service_traffic
Then the server starts throw exception
View server source code, under normal circumstances method "ids" the return should be less than or equal to the length of String[] ids. However, because service_traffic is repeated, one id can search two results, resulting in totalHits greater than the actual. So throw ArrayIndexOutOfBoundsException.
We should guarantee the stability of es, but there will always be unexpected situations, hoping that skywalking is fault-tolerant. Because in the previous version, at most only some trace data was lost.