[improve](transaction) extend abort transaction time (#28662)

This commit is contained in:
HHoflittlefish777
2023-12-21 14:01:05 +08:00
committed by GitHub
parent d11bb11592
commit 4ee661202e
4 changed files with 29 additions and 1 deletions

View File

@ -587,6 +587,16 @@ Is it possible to configure dynamically: true
Whether it is a configuration item unique to the Master FE node: true
### `abort_txn_after_lost_heartbeat_time_second`
Abort transaction time after lost heartbeat. The default value is 300, which means transactions of be will be aborted after lost heartbeat 300s.
Default: 300(s)
Is it possible to configure dynamically: true
Whether it is a configuration item unique to the Master FE node: true
#### `enable_access_file_without_broker`
Default:false

View File

@ -587,6 +587,16 @@ FE向BE的BackendService发送rpc请求时的超时时间,单位:毫秒。
是否为 Master FE 节点独有的配置项:true
#### `abort_txn_after_lost_heartbeat_time_second`
丢失be心跳后丢弃be事务的时间。默认时间为三百秒,当三百秒fe没有接收到be心跳时,会丢弃该be的所有事务。
默认值:300(秒)
是否可以动态配置:true
是否为 Master FE 节点独有的配置项:true
#### `enable_access_file_without_broker`
默认值:false

View File

@ -1782,6 +1782,13 @@ public class Config extends ConfigBase {
@ConfField(mutable = true, masterOnly = true)
public static long max_backend_heartbeat_failure_tolerance_count = 1;
/**
* Abort transaction time after lost heartbeat.
* The default value is 300s, which means transactions of be will be aborted after lost heartbeat 300s.
*/
@ConfField(mutable = true, masterOnly = true)
public static int abort_txn_after_lost_heartbeat_time_second = 300;
/**
* Heartbeat interval in seconds.
* Default is 10, which means every 10 seconds, the master will send a heartbeat to all backends.

View File

@ -174,7 +174,8 @@ public class HeartbeatMgr extends MasterDaemon {
if (hbResponse.getStatus() != HbStatus.OK) {
// invalid all connections cached in ClientPool
ClientPool.backendPool.clearPool(new TNetworkAddress(be.getHost(), be.getBePort()));
if (!isReplay && System.currentTimeMillis() - be.getLastUpdateMs() > 60 * 1000L) {
if (!isReplay && System.currentTimeMillis() - be.getLastUpdateMs()
>= Config.abort_txn_after_lost_heartbeat_time_second * 1000L) {
Env.getCurrentGlobalTransactionMgr()
.abortTxnWhenCoordinateBeDown(be.getHost(), 100);
}