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:Support to obtain multiple configurations through a single key in etcd3 #3327

Merged
merged 27 commits into from
Sep 14, 2021

Conversation

Rubbernecker
Copy link
Contributor

Ⅰ. Describe what this PR did

添加从etcd3单一key获取多条配置功能,registry.conf文件添加config.etcd3.key属性用于指定etcd3中的key。

Ⅱ. Does this pull request fix one issue?

#2506 #2316

Ⅲ. Why don't you add test cases (unit test/integration test)?

此功能在原有功能上修改,不方便写测试用例。

Ⅳ. Describe how to verify it

其他功能正常配置后,在registry.conf文件中将config.type设置为“etcd3”,添加config.etcd3.key属性,属性值为etcd3中的key,例如“seata.properties”,启动seata应用(server或client都可以),会自动拉取etcd3上“seata.properties”中的配置。

应用中的配置如下,根据项目选择对应的配置方式:

application.yml

image

registry.conf

image

etcd3中的属性配置如下:
image

Ⅴ. Special notes for reviews

将config.type设置为“etcd3”。
此功能已实现动态配置,同时兼容旧的配置方式。
seata-server也可以通过这种方式配置。
由于etcd3没有可视化界面,建议使用脚本导入配置,或自行开发对应的ui界面。

@Rubbernecker
Copy link
Contributor Author

@a364176773

@codecov-io
Copy link

codecov-io commented Jan 9, 2021

Codecov Report

Merging #3327 (cb5731b) into develop (108e83c) will increase coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3327   +/-   ##
==========================================
  Coverage      51.56%   51.56%           
- Complexity      3373     3375    +2     
==========================================
  Files            617      617           
  Lines          20438    20442    +4     
  Branches        2565     2565           
==========================================
+ Hits           10538    10541    +3     
- Misses          8839     8842    +3     
+ Partials        1061     1059    -2     
Impacted Files Coverage Δ Complexity Δ
...igure/properties/config/ConfigEtcd3Properties.java 44.44% <25.00%> (-15.56%) 2.00 <0.00> (ø)
...in/java/io/seata/server/session/GlobalSession.java 84.09% <0.00%> (+0.45%) 72.00% <0.00%> (+1.00%)
...o/seata/server/coordinator/DefaultCoordinator.java 54.41% <0.00%> (+0.49%) 29.00% <0.00%> (+1.00%)

@xingfudeshi xingfudeshi self-requested a review March 15, 2021 01:37
@funky-eyes
Copy link
Contributor

这个pr冲突也解决一下

qiancheng added 2 commits September 8, 2021 16:46
� Conflicts:
�	changes/1.5.0.md
�	changes/en-us/1.5.0.md
�	config/seata-config-etcd3/src/main/java/io/seata/config/etcd3/EtcdConfiguration.java
�	script/server/config/registry.conf
�	script/server/config/registry.properties
�	script/server/config/registry.yml
�	server/src/main/resources/registry.conf
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2021

Codecov Report

Merging #3327 (5357628) into develop (f028831) will increase coverage by 0.04%.
The diff coverage is 35.52%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3327      +/-   ##
=============================================
+ Coverage      49.34%   49.38%   +0.04%     
- Complexity      3721     3725       +4     
=============================================
  Files            692      692              
  Lines          23419    23443      +24     
  Branches        2902     2911       +9     
=============================================
+ Hits           11555    11578      +23     
+ Misses         10701    10699       -2     
- Partials        1163     1166       +3     
Impacted Files Coverage Δ
...io/seata/core/rpc/netty/AbstractNettyRemoting.java 14.28% <0.00%> (ø)
...source/exec/mysql/MySQLInsertOrUpdateExecutor.java 31.42% <ø> (-0.04%) ⬇️
...urce/exec/postgresql/PostgresqlInsertExecutor.java 43.75% <0.00%> (ø)
...seata/rm/datasource/undo/AbstractUndoExecutor.java 66.90% <0.00%> (ø)
...ta/spring/boot/autoconfigure/StarterConstants.java 0.00% <ø> (ø)
...figure/properties/registry/RegistryProperties.java 37.50% <0.00%> (-22.50%) ⬇️
.../src/main/java/io/seata/server/env/PortHelper.java 0.00% <0.00%> (ø)
...igure/properties/config/ConfigEtcd3Properties.java 44.44% <25.00%> (-15.56%) ⬇️
...ure/properties/server/store/StoreDBProperties.java 28.07% <25.00%> (-0.24%) ⬇️
server/src/main/java/io/seata/server/Server.java 75.00% <33.33%> (-5.00%) ⬇️
... and 9 more

@Rubbernecker
Copy link
Contributor Author

这个pr冲突也解决一下

@a364176773 解决好了,已经提交了

@funky-eyes
Copy link
Contributor

这个pr冲突也解决一下

@a364176773 解决好了,已经提交了

ok,consul那个pr我解决了下冲突合并进去了,你看下我解决的有没有问题,如果有问题再提个fix的pr

qiancheng added 3 commits September 13, 2021 10:44
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.

LGTM @xingfudeshi PTAL

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@xingfudeshi xingfudeshi merged commit 2bca587 into apache:develop Sep 14, 2021
@slievrly slievrly added this to the 1.5.0 milestone Sep 14, 2021
UmmizzZ pushed a commit to UmmizzZ/seata that referenced this pull request Sep 30, 2021
@funky-eyes
Copy link
Contributor

https://cla-assistant.io/seata/seata 请登录对应的github账号打开cla链接签署,感谢大家配合

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants