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 issue of missing sentinel password in store redis mode #5930

Merged
merged 11 commits into from
Oct 18, 2023

Conversation

PeppaO
Copy link
Contributor

@PeppaO PeppaO commented Oct 14, 2023

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

当store.redis.mode=sentinel时,设置哨兵密码时,代码中缺少哨兵密码

Ⅱ. Does this pull request fix one issue?

Fixes #4161

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

import redis.clients.jedis.JedisPoolAbstract;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

不要使用*引入

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -98,7 +94,8 @@ public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisP
Set<String> sentinels = new HashSet<>(SENTINEL_HOST_NUMBER);
String[] sentinelHosts = CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_HOST).split(",");
Arrays.asList(sentinelHosts).forEach(sentinelHost -> sentinels.add(sentinelHost));
tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE));
tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE),
null, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_PASSWORD), null);
Copy link
Contributor

Choose a reason for hiding this comment

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

这后面的null是什么参数?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clientName、sentinelClientName

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

不止这里,server的yml里的配置要补充,以及starter模块里对应的properties也要补充

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@PeppaO PeppaO changed the title fix the problem of missing sentinel password in store redis mode bugfix: fix the problem of missing sentinel password in store redis mode Oct 17, 2023
@PeppaO PeppaO changed the title bugfix: fix the problem of missing sentinel password in store redis mode bugfix: fix the issue of missing sentinel password in store redis mode Oct 17, 2023
@CLAassistant
Copy link

CLAassistant commented Oct 17, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #5930 (4f59905) into 2.x (3baf2b4) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5930      +/-   ##
============================================
+ Coverage     49.50%   49.51%   +0.01%     
- Complexity     4510     4515       +5     
============================================
  Files           854      854              
  Lines         29876    29880       +4     
  Branches       3660     3660              
============================================
+ Hits          14789    14795       +6     
+ Misses        13601    13595       -6     
- Partials       1486     1490       +4     
Files Coverage Δ
...c/main/java/io/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
...seata/server/storage/redis/JedisPooledFactory.java 25.53% <0.00%> (-0.56%) ⬇️
.../properties/server/store/StoreRedisProperties.java 30.76% <0.00%> (-1.89%) ⬇️

... and 6 files with indirect coverage changes

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

@funky-eyes funky-eyes added this to the 2.0.0 milestone Oct 17, 2023
@funky-eyes funky-eyes added type: bug Category issues or prs related to bug. module/server server module TC/store store mode labels Oct 17, 2023
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 6b13379 into apache:2.x Oct 18, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/server server module TC/store store mode type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seata接入Redis哨兵集群失败
4 participants