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

bugfix: fix the application was configured to degrade at startup and can't be dynamically switch to upgraded #2929

Merged
merged 8 commits into from
Oct 10, 2020

Conversation

slievrly
Copy link
Member

Signed-off-by: slievrly slievrly@163.com

Ⅰ. Describe what this PR did

bugfix: fix the application was configured to degrade at startup and can't be dynamically switch to upgraded

Ⅱ. Does this pull request fix one issue?

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

Ⅳ. Describe how to verify it

before startup: service.disableGlobalTransaction=true;
after startup: service.disableGlobalTransaction=true;
Note that you need to use a configuration center that is not of file type. Dynamic configuration does not take effect when using seata-spring-boot-starter && type=file.

Ⅴ. Special notes for reviews

…can't be dynamically switch to upgraded

Signed-off-by: slievrly <slievrly@163.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2020

Codecov Report

Merging #2929 into develop will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2929      +/-   ##
=============================================
+ Coverage      56.18%   56.24%   +0.05%     
- Complexity       559      561       +2     
=============================================
  Files             57       57              
  Lines           3458     3458              
  Branches         423      423              
=============================================
+ Hits            1943     1945       +2     
  Misses          1262     1262              
+ Partials         253      251       -2     
Impacted Files Coverage Δ Complexity Δ
...in/java/io/seata/server/session/GlobalSession.java 82.88% <0.00%> (+0.45%) 71.00% <0.00%> (+1.00%)
...o/seata/server/coordinator/DefaultCoordinator.java 55.15% <0.00%> (+0.51%) 29.00% <0.00%> (+1.00%)


private static final Logger LOGGER = LoggerFactory.getLogger(TccActionInterceptor.class);

private ActionInterceptorHandler actionInterceptorHandler = new ActionInterceptorHandler();

private boolean disable = ConfigurationFactory.getInstance().getBoolean(ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
Copy link
Contributor

Choose a reason for hiding this comment

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

DISABLE_GLOBAL_TRANSACTION 已经被订阅了,此类并未有其他需要监听处理的业务,为何不直接创建位局部变量,进行getBoolean?

Copy link
Member Author

Choose a reason for hiding this comment

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

for the upgrade and downgrade functions,needs to be explicitly printed in the log.

Copy link
Contributor

Choose a reason for hiding this comment

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

volatile

@xianshi122
Copy link

经过验证,service.disableGlobalTransaction的功能,已经生效
环境:springcloud+nacos+seata,
启动前nacos配置 service.disableGlobalTransaction=true
启动后修改nacos配置 service.disableGlobalTransaction=false,
打印以下日志,初始化 Global Transaction Clients
2020-07-27 15:31:10.343 - INFO - --- [configListenerOperate_1_1] i.s.s.a.GlobalTransactionScanner [180] : Resource Manager is initialized. applicationId[haizol-test-service1] txServiceGroup[haizol_tx_group]
2020-07-27 15:31:10.344 - INFO - --- [configListenerOperate_1_1] i.s.s.a.GlobalTransactionScanner [184] : Global Transaction Clients are initialized.
操作事务相关业务,注册RM 全局事务已触发
image

@funky-eyes funky-eyes added this to the 1.4.0 milestone Jul 30, 2020
@funky-eyes funky-eyes added TM Relate to seata tm module/tm tm module and removed TM Relate to seata tm labels Jul 30, 2020
@@ -78,8 +80,9 @@
private final String applicationId;
private final String txServiceGroup;
private final int mode;
private final boolean disableGlobalTransaction = ConfigurationFactory.getInstance().getBoolean(
private boolean disableGlobalTransaction = ConfigurationFactory.getInstance().getBoolean(
Copy link
Contributor

Choose a reason for hiding this comment

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

volatile ?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@funky-eyes
Copy link
Contributor

resolve code conflicts

Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>

# Conflicts:
#	spring/src/main/java/io/seata/spring/tcc/TccActionInterceptor.java
Signed-off-by: slievrly <slievrly@163.com>

# Conflicts:
#	spring/src/main/java/io/seata/spring/tcc/TccActionInterceptor.java
@codecov-io
Copy link

codecov-io commented Oct 10, 2020

Codecov Report

Merging #2929 into develop will decrease coverage by 0.00%.
The diff coverage is 30.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2929      +/-   ##
=============================================
- Coverage      50.41%   50.41%   -0.01%     
- Complexity      3124     3126       +2     
=============================================
  Files            594      594              
  Lines          19685    19700      +15     
  Branches        2457     2460       +3     
=============================================
+ Hits            9925     9932       +7     
- Misses          8755     8765      +10     
+ Partials        1005     1003       -2     
Impacted Files Coverage Δ Complexity Δ
...java/io/seata/spring/tcc/TccActionInterceptor.java 12.00% <14.28%> (+0.63%) 2.00 <0.00> (ø)
...ta/spring/annotation/GlobalTransactionScanner.java 50.00% <38.46%> (-1.52%) 17.00 <2.00> (ø)
...in/java/io/seata/server/session/GlobalSession.java 82.88% <0.00%> (+0.45%) 71.00% <0.00%> (+1.00%)
...torage/file/store/FileTransactionStoreManager.java 57.41% <0.00%> (+0.64%) 29.00% <0.00%> (+1.00%)

Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

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

LGTM

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

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly merged commit f6d6161 into apache:develop Oct 10, 2020
l81893521 pushed a commit to l81893521/seata that referenced this pull request Oct 22, 2020
hicf pushed a commit to hicf/seata that referenced this pull request Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/tm tm module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants