Skip to content

Commit

Permalink
optimize: fix failed to get server recovery properties (apache#4915)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuwenlin authored Sep 7, 2022
1 parent c384cc7 commit 6c739ce
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 9 deletions.
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#4779](https://github.com/seata/seata/pull/4779)] fix and support Apache Dubbo 3
- [[#4912](https://github.com/seata/seata/pull/4912)] fix mysql InsertOnDuplicateUpdate column case is different and cannot be matched
- [[#4543](https://github.com/seata/seata/pull/4543)] fix support Oracle nclob types
- [[#4915](https://github.com/seata/seata/pull/4915)] fix failed to get server recovery properties


### optimize:
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [[#4779](https://github.com/seata/seata/pull/4779)] 修复支持 Apache Dubbo 3 版本
- [[#4912](https://github.com/seata/seata/pull/4912)] 修复mysql InsertOnDuplicateUpdate 列名大小写不一致无法正确匹配
- [[#4543](https://github.com/seata/seata/pull/4543)] 修复对 Oracle 数据类型nclob的支持
- [[#4915](https://github.com/seata/seata/pull/4915)] 修复获取不到ServerRecoveryProperties属性的问题

### optimize:
- [[#4774](https://github.com/seata/seata/pull/4774)] 优化 seataio/seata-server 镜像中的 mysql8 依赖
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public interface ConfigurationKeys {
/**
* The constant ASYN_COMMITING_RETRY_PERIOD.
*/
String ASYN_COMMITING_RETRY_PERIOD = RECOVERY_PREFIX + "asynCommittingRetryPeriod";
String ASYNC_COMMITING_RETRY_PERIOD = RECOVERY_PREFIX + "asyncCommittingRetryPeriod";

/**
* The constant ROLLBACKING_RETRY_PERIOD.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,44 @@
@ConfigurationProperties(prefix = SERVER_RECOVERY_PREFIX)
public class ServerRecoveryProperties {

private Integer handleAllSessionPeriod = 1000;
private int committingRetryPeriod = 1000;
private int asyncCommittingRetryPeriod = 1000;
private int rollbackingRetryPeriod = 1000;
private int timeoutRetryPeriod = 1000;

public Integer getHandleAllSessionPeriod() {
return handleAllSessionPeriod;
public int getCommittingRetryPeriod() {
return committingRetryPeriod;
}

public ServerRecoveryProperties setHandleAllSessionPeriod(Integer handleAllSessionPeriod) {
this.handleAllSessionPeriod = handleAllSessionPeriod;
public ServerRecoveryProperties setCommittingRetryPeriod(int committingRetryPeriod) {
this.committingRetryPeriod = committingRetryPeriod;
return this;
}

public int getAsyncCommittingRetryPeriod() {
return asyncCommittingRetryPeriod;
}

public ServerRecoveryProperties setAsyncCommittingRetryPeriod(int asyncCommittingRetryPeriod) {
this.asyncCommittingRetryPeriod = asyncCommittingRetryPeriod;
return this;
}

public int getRollbackingRetryPeriod() {
return rollbackingRetryPeriod;
}

public ServerRecoveryProperties setRollbackingRetryPeriod(int rollbackingRetryPeriod) {
this.rollbackingRetryPeriod = rollbackingRetryPeriod;
return this;
}

public Integer getTimeoutRetryPeriod() {
return timeoutRetryPeriod;
}

public ServerRecoveryProperties setTimeoutRetryPeriod(int timeoutRetryPeriod) {
this.timeoutRetryPeriod = timeoutRetryPeriod;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public void testServerProperties() {

@Test
public void testServerRecoveryProperties() {
assertEquals(context.getBean(ServerRecoveryProperties.class).getHandleAllSessionPeriod(), 1000);
assertEquals(context.getBean(ServerRecoveryProperties.class).getAsyncCommittingRetryPeriod(), 1000);
assertEquals(context.getBean(ServerRecoveryProperties.class).getCommittingRetryPeriod(), 1000);
assertEquals(context.getBean(ServerRecoveryProperties.class).getRollbackingRetryPeriod(), 1000);
assertEquals(context.getBean(ServerRecoveryProperties.class).getTimeoutRetryPeriod(), 1000);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class DefaultCoordinator extends AbstractTCInboundHandler implements Tran
* The constant ASYNC_COMMITTING_RETRY_PERIOD.
*/
protected static final long ASYNC_COMMITTING_RETRY_PERIOD = CONFIG.getLong(
ConfigurationKeys.ASYN_COMMITING_RETRY_PERIOD, 1000L);
ConfigurationKeys.ASYNC_COMMITING_RETRY_PERIOD, 1000L);

/**
* The constant ROLLBACKING_RETRY_PERIOD.
Expand Down
5 changes: 4 additions & 1 deletion server/src/main/resources/application.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ seata:
retry-dead-threshold: 130000
xaer-nota-retry-timeout: 60000
recovery:
handle-all-session-period: 1000
committing-retry-period: 1000
async-committing-retry-period: 1000
rollbacking-retry-period: 1000
timeout-retry-period: 1000
undo:
log-save-days: 7
log-delete-period: 86400000
Expand Down

0 comments on commit 6c739ce

Please sign in to comment.