-
Notifications
You must be signed in to change notification settings - Fork 8.9k
bugfix: fix incorrect metric report #6018
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
bugfix: fix incorrect metric report #6018
Conversation
| globalSession.changeGlobalStatus(GlobalStatus.Committed); | ||
| } | ||
| globalSession.end(); | ||
| if (!DELAY_HANDLE_SESSION) { |
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.
file和raft模式时,外层的if是不成立的,所以需要在这里打end的点和after的点,而其它模式在二阶段决议时是走的else逻辑,committed已经在二阶段决议时完成了,所以在这不需要再打点
file and raft mode, the outer if is not established, so you need to hit the end of the point here and after the point, while the other modes in the two-stage resolution is to go to the else logic, committed has been completed in the two-stage resolution, so no need to hit the point here!
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.
Got it. Leave this line unchanged, and modify the MetricsPublisher.postSessionDoneEvent(globalSession, false, false); to MetricsPublisher.postSessionDoneEvent(globalSession, retryGlobal, false); in the inner block. I think that makes more sense.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6018 +/- ##
============================================
+ Coverage 49.59% 49.67% +0.08%
- Complexity 4766 4776 +10
============================================
Files 911 911
Lines 31316 31316
Branches 3773 3773
============================================
+ Hits 15530 15557 +27
+ Misses 14253 14225 -28
- Partials 1533 1534 +1
|
funky-eyes
left a comment
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
Ⅰ. Describe what this PR did
Fix incorrect metric report.
It's actually a accidental code error. The conditions in
https://github.com/seata/seata/blob/8192138895ada3cc7cd09977f3219ed8371c17ae/server/src/main/java/io/seata/server/session/SessionHelper.java#L149
and in
https://github.com/seata/seata/blob/8192138895ada3cc7cd09977f3219ed8371c17ae/server/src/main/java/io/seata/server/session/SessionHelper.java#L221
intend to distinguish whether
retryGlobalis true or false. Therefore,retryGlobalshould be evaluated instead ofDELAY_HANDLE_SESSION.Ⅱ. Does this pull request fix one issue?
fixes #6016
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews