Skip to content
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

feature: seata-server support http protocol #6801

Open
wants to merge 74 commits into
base: 2.x
Choose a base branch
from

Conversation

PleaseGiveMeTheCoke
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

support http protocol

Ⅱ. 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

PleaseGiveMeTheCoke and others added 30 commits August 14, 2024 08:06
2. support multi-version
…seata/serializer/protobuf/GrpcSerializer.java
# Conflicts:
#	core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 25.81967% with 181 lines in your changes missing coverage. Please review.

Project coverage is 52.59%. Comparing base (fabccea) to head (043df21).

Files with missing lines Patch % Lines
...che/seata/core/rpc/netty/http/ParameterParser.java 0.00% 43 Missing ⚠️
...ata/core/rpc/netty/http2/Http2DispatchHandler.java 0.00% 36 Missing ⚠️
...seata/core/rpc/netty/http/HttpDispatchHandler.java 0.00% 33 Missing ⚠️
...seata/core/rpc/netty/http2/Http2DetectHandler.java 0.00% 14 Missing ⚠️
...ache/seata/core/rpc/netty/http/HttpInvocation.java 0.00% 13 Missing ⚠️
...che/seata/core/protocol/detector/HttpDetector.java 15.38% 11 Missing ⚠️
...pache/seata/core/rpc/netty/http/ParamMetaData.java 0.00% 8 Missing ⚠️
.../server/cluster/manager/ClusterWatcherManager.java 0.00% 6 Missing ⚠️
...e/seata/server/controller/ClusterV2Controller.java 14.28% 6 Missing ⚠️
...e/seata/core/rpc/netty/http/ControllerManager.java 0.00% 5 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6801      +/-   ##
============================================
+ Coverage     52.53%   52.59%   +0.05%     
- Complexity     6541     6553      +12     
============================================
  Files          1122     1130       +8     
  Lines         39858    39861       +3     
  Branches       4666     4657       -9     
============================================
+ Hits          20940    20965      +25     
+ Misses        16925    16907      -18     
+ Partials       1993     1989       -4     
Files with missing lines Coverage Δ
...in/java/org/apache/seata/common/DefaultValues.java 0.00% <ø> (ø)
...he/seata/core/rpc/netty/ProtocolDetectHandler.java 63.15% <100.00%> (ø)
...eata/namingserver/controller/NamingController.java 38.88% <ø> (ø)
...he/seata/core/protocol/detector/Http2Detector.java 31.25% <0.00%> (+3.47%) ⬆️
...e/seata/core/rpc/netty/http/ControllerManager.java 0.00% <0.00%> (ø)
...er/spring/web/RestControllerBeanPostProcessor.java 92.18% <92.18%> (ø)
.../server/cluster/manager/ClusterWatcherManager.java 30.00% <0.00%> (ø)
...e/seata/server/controller/ClusterV2Controller.java 14.28% <14.28%> (ø)
...pache/seata/core/rpc/netty/http/ParamMetaData.java 0.00% <0.00%> (ø)
...che/seata/core/protocol/detector/HttpDetector.java 15.38% <15.38%> (ø)
... and 5 more

... and 6 files with indirect coverage changes

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof Http2HeadersFrame) {
if (headerSent.compareAndSet(false, true)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个连接如果一直被复用,但是没有开启双向流的形式,使用http2传递不同的header,但是这里只读了一次,会不会有问题?
If this connection has been reused all the time, but the form of bidirectional streaming is not enabled, using HTTP2 to pass different headers, but only read it once, will there be a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unary模式的话,每次都会开启一条新的流,channel和handler都会创建新的

@@ -86,6 +91,16 @@ public void onChangeEvent(ClusterChangeEvent event) {
}

private void notify(Watcher<?> watcher) {
Channel channel = (Channel) watcher.getAsyncContext();
if (channel instanceof Http2StreamChannel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http1的呢?如果通过8091端口进来的v1/watch,可不是下面的HttpServletResponse逻辑能正常执行的
What about HTTP1? If v1/watch comes in through port 8091, the following HttpServletResponse logic can not be executed normally

@@ -55,7 +56,7 @@
/**
*/
@RestController
@RequestMapping("/metadata/v1")
@RequestMapping("/metadata")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么去除这里的v1,而在下面给每一个增加v1?

…to http_support

� Conflicts:
�	discovery/seata-discovery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增的配置项需要在https://github.com/apache/incubator-seata/tree/2.x/script/client 中的spring和file中添加示例

/**
* http1 or http2
*/
String HTTP_VERSION = TRANSPORT_PREFIX + "httpVersion";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该放到registry.raft下面,而不是transport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/core core module module/server server module type: feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants