-
Notifications
You must be signed in to change notification settings - Fork 8.9k
optimize: intercept non-leader write requests of the console trx operation #7215
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
Conversation
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.
raft事务控制的实现在哪里?
Where is the implementation of Raft transaction control?
server/src/main/java/org/apache/seata/server/filter/RaftLeaderWriteFilter.java
Outdated
Show resolved
Hide resolved
| if (!"GET".equalsIgnoreCase(method)) { | ||
| String group = SeataClusterContext.bindGroup(); | ||
| if (!isPass(group)) { | ||
| throw new ConsoleException(new TransactionException(TransactionExceptionCode.NotRaftLeader, |
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.
为什么是抛出异常,而不是响应某种result+状态码让namingserver能感知?
Why throw an exception instead of responding with a result and status code so that the naming server can be aware?
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 is a controller aspect that can capture console related errors and return them. Why need namingserver need to know? The error will be displayed on the console web client to user.
有一个controller的切面能够捕捉到console的相关错误,并返回。让namingserver感知是为什么,这个错误最后会在客户端展现给用户
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 is a controller aspect that can capture console related errors and return them. Why need namingserver need to know? The error will be displayed on the console web client to user. 有一个controller的切面能够捕捉到console的相关错误,并返回。让namingserver感知是为什么,这个错误最后会在客户端展现给用户
最后被全局异常捕获器包装了是吗?
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.
|
那这个pr只能是一个优化,拦截非leader的写请求 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7215 +/- ##
============================================
- Coverage 53.28% 53.27% -0.01%
- Complexity 7069 7074 +5
============================================
Files 1169 1171 +2
Lines 41585 41609 +24
Branches 4871 4873 +2
============================================
+ Hits 22158 22169 +11
- Misses 17328 17342 +14
+ Partials 2099 2098 -1
🚀 New features to boost your workflow:
|
server/src/main/java/org/apache/seata/server/filter/RaftLeaderWriteFilter.java
Outdated
Show resolved
Hide resolved
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
optimize: intercept non-leader write requests of the console trx operation
p.s The Raft mode of the global lock delete is not currently supported and needs to be fixed. @funky-eyes
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews