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 access key loss after server restart #5097

Merged

Conversation

renliangyu857
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

fixes #5080

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2022

Codecov Report

Merging #5097 (9f569ae) into develop (04e4fb5) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #5097      +/-   ##
=============================================
+ Coverage      49.31%   49.34%   +0.03%     
- Complexity      4135     4145      +10     
=============================================
  Files            737      737              
  Lines          26187    26187              
  Branches        3233     3233              
=============================================
+ Hits           12913    12923      +10     
+ Misses         11890    11881       -9     
+ Partials        1384     1383       -1     
Impacted Files Coverage Δ
...c/main/java/io/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
...ta/spring/annotation/GlobalTransactionScanner.java 30.65% <100.00%> (ø)
...java/io/seata/rm/datasource/DataSourceManager.java 14.63% <0.00%> (-9.76%) ⬇️
...c/main/java/io/seata/server/store/StoreConfig.java 59.45% <0.00%> (-2.71%) ⬇️
...n/java/io/seata/rm/datasource/DataSourceProxy.java 78.43% <0.00%> (-1.97%) ⬇️
...o/seata/server/session/AbstractSessionManager.java 58.20% <0.00%> (-1.50%) ⬇️
...datasource/exec/mysql/MySQLUpdateJoinExecutor.java 77.63% <0.00%> (-1.25%) ⬇️
...tasource/sql/struct/cache/MysqlTableMetaCache.java 78.88% <0.00%> (-1.12%) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 47.95% <0.00%> (+0.40%) ⬆️
...rage/redis/store/RedisTransactionStoreManager.java 74.67% <0.00%> (+0.52%) ⬆️
... and 9 more

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

@funky-eyes funky-eyes changed the title bugfix:fix access key loss after server restart bugfix: fix access key loss after server restart Nov 22, 2022
@funky-eyes funky-eyes added this to the 1.6.0 milestone Nov 24, 2022
@funky-eyes funky-eyes added module/core core module module/spring spring module type: bug Category issues or prs related to bug. labels Nov 24, 2022
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 @slievrly PTAL

super(nettyClientConfig, eventExecutorGroup, messageExecutor, NettyPoolKey.TransactionRole.TMROLE);
this.signer = EnhancedServiceLoader.load(AuthSigner.class);
this.applicationId = applicationId;
this.transactionServiceGroup = transactionServiceGroup;
this.accessKey = accessKey;
Copy link
Member

Choose a reason for hiding this comment

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

It is recommended to check whether the value is null. Setting the value to null is meaningless. Use the setXXX call directly

这里建议判断是否为null,设置为null是无意义的。直接使用setXXX调用。

* @return the instance
*/
public static TmNettyRemotingClient getInstance(String applicationId, String transactionServiceGroup) {
return getInstance(applicationId, transactionServiceGroup, null, null);
Copy link
Member

Choose a reason for hiding this comment

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

It is recommended to retain the method without the ak/sk parameter.


建议保留无ak/sk 参数的方法。

this.accessKey = accessKey;
return;
}
this.accessKey = System.getProperty(SEATA_ACCESS_KEY);
Copy link
Member

Choose a reason for hiding this comment

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

It is recommended to keep this part, but also to determine if it is null.


建议保留,但同样需要判空。

Copy link
Member

@slievrly slievrly 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 7aeff88 into apache:develop Nov 27, 2022
zw201913 pushed a commit to zw201913/seata that referenced this pull request Dec 12, 2022
…o 1114_for_5073

* '1114_for_5073' of https://github.com/zw201913/seata:
  bugfix: hikari datasource auto proxy fail (apache#5134)
  bugfix: rollback active xa connection fail (apache#5131)
  optimize: support oracle on delete tccfence logs  (apache#5124)
  feature: support passing `contextPath` parameter to Nacos client (apache#5111)
  bugfix:NPE caused when there is no @GlobalTransactional annotation on the RM side  (apache#5109)
  bugfix: Druid disable oracle implicit cache (apache#5098)
  bugfix: fix access key loss after server restart (apache#5097)
  optimize: remove druid dependency in ConnectionProxy (apache#5104)
  bugfix:fix ClassNotFoundException during the ZK unit test (apache#5101)
  bugfix: fix when seata and jpa are used together, their AutoConfiguration order is incorrect (apache#5092)
  optimize: lock priority attempts to insert (apache#4681)
  bugfix: update join condition placeholder param error (apache#5052)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/core core module module/spring spring module multilingual type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

客户端注册TM参数access-key问题
5 participants