Skip to content

Commit

Permalink
Merge branch 'develop' into test-os
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 authored Oct 18, 2023
2 parents 0003f03 + 046e384 commit c7fe522
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 13 deletions.
4 changes: 4 additions & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Add changes here for all PR submitted to the develop branch.
### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] bugfix: fix TC retry rollback wrongly, after the XA transaction fail and rollback
- [[#5884](https://github.com/seata/seata/pull/5884)] fix dm escaped characters for upper and lower case column names
- [[#5924](https://github.com/seata/seata/pull/5924)] fix zk unit test error
- [[#5931](https://github.com/seata/seata/pull/5931)] fix the issue of missing sentinel password in store redis mode

### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] some minor syntax optimization
Expand All @@ -18,6 +20,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#5828](https://github.com/seata/seata/pull/5828)] fix codecov chart not display
- [[#5927](https://github.com/seata/seata/pull/5927)] optimize some scripts related to Apollo
- [[#5918](https://github.com/seata/seata/pull/5918)] standardized the properties of codecov.yml
- [[#5939](https://github.com/seata/seata/pull/5939)] support jmx port in seata

### security:
- [[#5867](https://github.com/seata/seata/pull/5867)] fix npm package vulnerabilities
Expand All @@ -37,6 +40,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [capthua](https://github.com/capthua)
- [funky-eyes](https://github.com/funky-eyes)
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
4 changes: 4 additions & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] bugfix: 修复当 XA 事务失败回滚后,TC 还会继续重试回滚的问题
- [[#5884](https://github.com/seata/seata/pull/5884)] 修复达梦前后镜像查询列名都加了引号导致sql异常的问题
- [[#5924](https://github.com/seata/seata/pull/5924)] 修复zk单元测试错误
- [[#5931](https://github.com/seata/seata/pull/5931)] 修复存储redis哨兵模式下哨兵密码缺失的问题

### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] 一些小的语法优化
Expand All @@ -18,6 +20,7 @@
- [[#5828](https://github.com/seata/seata/pull/5828)] 修正 `codecov chart` 不展示的问题
- [[#5927](https://github.com/seata/seata/pull/5927)] 优化一些与 Apollo 相关的脚本
- [[#5918](https://github.com/seata/seata/pull/5918)] 修正codecov.yml不标准属性
- [[#5939](https://github.com/seata/seata/pull/5939)] 支持 jmx 监控配置

### security:
- [[#5867](https://github.com/seata/seata/pull/5867)] 修复npm package漏洞
Expand All @@ -37,5 +40,6 @@
- [capthua](https://github.com/capthua)
- [funky-eyes](https://github.com/funky-eyes)
- [iquanzhan](https://github.com/iquanzhan)
- [leizhiyuan](https://github.com/leizhiyuan)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
5 changes: 5 additions & 0 deletions common/src/main/java/io/seata/common/ConfigurationKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,11 @@ public interface ConfigurationKeys {
*/
String STORE_REDIS_SENTINEL_HOST = STORE_REDIS_SENTINEL_PREFIX + "sentinelHosts";

/**
* STORE_REDIS_SENTINEL_PASSWORD.
*/
String STORE_REDIS_SENTINEL_PASSWORD = STORE_REDIS_SENTINEL_PREFIX + "sentinelPassword";

/**
* The constant CLIENT_DEGRADE_CHECK_PERIOD.
*/
Expand Down
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<kafka-appender.version>0.2.0-RC2</kafka-appender.version>

<!-- redis -->
<jedis.version>3.2.0</jedis.version>
<jedis.version>3.8.0</jedis.version>

<!-- # for database -->
<!-- db -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private ZkClient getClientInstance() {
}

// visible for test.
ZkClient buildZkClient(String address, int sessionTimeout, int connectTimeout,String... authInfo) {
private ZkClient buildZkClient(String address, int sessionTimeout, int connectTimeout,String... authInfo) {
ZkClient zkClient = new ZkClient(address, sessionTimeout, connectTimeout);
if (authInfo != null && authInfo.length == 2) {
if (!StringUtils.isBlank(authInfo[0]) && !StringUtils.isBlank(authInfo[1])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ public void getInstance() {
Assertions.assertEquals(service1, service);
}

@Test
public void buildZkTest() {
ZkClient client = service.buildZkClient("127.0.0.1:2181", 5000, 5000);
Assertions.assertTrue(client.exists("/zookeeper"));
}

@Test
public void testAll() throws Exception {
service.register(new InetSocketAddress(NetUtil.getLocalAddress(), 33333));
Expand Down
15 changes: 14 additions & 1 deletion distribution/bin/seata-server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,21 @@ if "%SKYWALKING_ENABLE%"=="true" (
) else (
echo "apm-skywalking not enabled"
)
if "%JMX_ENABLE%"=="true" (
set JMX_PORT=%JMX_PORT%
set JMX_OPTS=%JMX_OPTS%
if "%JMX_OPTS%"=="" (
set "JMX_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
)
if "%JMX_PORT%"=="" (
set "JMX_OPTS=%JMX_OPTS% -Dcom.sun.management.jmxremote.port=10055 -Dcom.sun.management.jmxremote.rmi.port=10055"
)
echo "JMX enabled"
) else (
echo "JMX disabled"
)

%JAVACMD% %JAVA_OPTS% %SKYWALKING_OPTS% -server -Dloader.path="%BASEDIR%"/lib -Xmx2048m -Xms2048m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BASEDIR%"/logs/java_heapdump.hprof -XX:+DisableExplicitGC -Xloggc:"%BASEDIR%"/logs/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced -classpath %CLASSPATH% -Dapp.name="seata-server" -Dapp.repo="%REPO%" -Dapp.home="%BASEDIR%" -Dbasedir="%BASEDIR%" -Dspring.config.additional-location="%BASEDIR%"/conf/ -Dspring.config.location="%BASEDIR%"/conf/application.yml -Dlogging.config="%BASEDIR%"/conf/logback-spring.xml -jar "%BASEDIR%"/target/seata-server.jar %CMD_LINE_ARGS%
%JAVACMD% %JAVA_OPTS% %SKYWALKING_OPTS% %JMX_OPTS% -server -Dloader.path="%BASEDIR%"/lib -Xmx2048m -Xms2048m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BASEDIR%"/logs/java_heapdump.hprof -XX:+DisableExplicitGC -Xloggc:"%BASEDIR%"/logs/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced -classpath %CLASSPATH% -Dapp.name="seata-server" -Dapp.repo="%REPO%" -Dapp.home="%BASEDIR%" -Dbasedir="%BASEDIR%" -Dspring.config.additional-location="%BASEDIR%"/conf/ -Dspring.config.location="%BASEDIR%"/conf/application.yml -Dlogging.config="%BASEDIR%"/conf/logback-spring.xml -jar "%BASEDIR%"/target/seata-server.jar %CMD_LINE_ARGS%
if %ERRORLEVEL% NEQ 0 goto error
goto end

Expand Down
15 changes: 15 additions & 0 deletions distribution/bin/seata-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ fi
JAVA_OPT="${JAVA_OPT} -Dio.netty.leakDetectionLevel=advanced"
JAVA_OPT="${JAVA_OPT} -Dapp.name=seata-server -Dapp.pid=${$} -Dapp.home=${BASEDIR} -Dbasedir=${BASEDIR}"

if [ "$JMX_ENABLE" = "true" ]; then
JMX_PORT=$JMX_PORT
JMX_OPTS=$JMX_OPTS
if [ -z "$JMX_OPTS" ]; then
JMX_OPTS=" -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
if [ -z "$JMX_PORT" ]; then
JMX_OPTS=" $JMX_OPTS -Dcom.sun.management.jmxremote.port=${JMX_PORT:="10055"} -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT:="10055"} "
fi
echo "JMX enabled"
else
echo "JMX disabled"
fi

JAVA_OPT="${JAVA_OPT} ${JMX_OPTS}"

if [ ! -x "$BASEDIR"/logs ]; then
mkdir "$BASEDIR"/logs
Expand Down
1 change: 1 addition & 0 deletions script/config-center/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ store.redis.single.host=127.0.0.1
store.redis.single.port=6379
store.redis.sentinel.masterName=
store.redis.sentinel.sentinelHosts=
store.redis.sentinel.sentinelPassword=
store.redis.maxConn=10
store.redis.minConn=1
store.redis.maxTotal=100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public static class Sentinel {
*/
private String sentinelHosts;

private String sentinelPassword;

public String getMasterName() {
return masterName;
}
Expand All @@ -159,5 +161,14 @@ public Sentinel setSentinelHosts(String sentinelHosts) {
this.sentinelHosts = sentinelHosts;
return this;
}

public String getSentinelPassword() {
return sentinelPassword;
}

public Sentinel setSentinelPassword(String sentinelPassword) {
this.sentinelPassword = sentinelPassword;
return this;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
import io.seata.core.constants.ConfigurationKeys;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolAbstract;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.Jedis;

import static io.seata.common.DefaultValues.DEFAULT_REDIS_MAX_IDLE;
import static io.seata.common.DefaultValues.DEFAULT_REDIS_MAX_TOTAL;
Expand Down Expand Up @@ -59,7 +60,7 @@ public class JedisPooledFactory {

/**
* get the RedisPool instance (singleton)
*
*
* @return redisPool
*/
public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisPools) {
Expand Down Expand Up @@ -98,7 +99,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);
} else if (mode.equals(ConfigurationKeys.REDIS_SINGLE_MODE)) {
String host = CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SINGLE_HOST);
host = StringUtils.isBlank(host) ? CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_HOST, HOST) : host;
Expand All @@ -121,7 +123,7 @@ public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisP

/**
* get an instance of Jedis (connection) from the connection pool
*
*
* @return jedis
*/
public static Jedis getJedisInstance() {
Expand Down
1 change: 1 addition & 0 deletions server/src/main/resources/application.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ seata:
sentinel:
master-name:
sentinel-hosts:
sentinel-password:
metrics:
enabled: false
registry-type: compact
Expand Down

0 comments on commit c7fe522

Please sign in to comment.