This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new ab36512c1e [fix](heartbeat) need to set backend status base on edit
log (#21409)
ab36512c1e is described below
commit ab36512c1e020581285f3baee6c01ef1d83cbd7d
Author: Mingyu Chen <[email protected]>
AuthorDate: Sat Jul 1 23:02:40 2023 +0800
[fix](heartbeat) need to set backend status base on edit log (#21409)
cherry pick #21410
---
fe/fe-core/src/main/java/org/apache/doris/system/Backend.java | 5 +++--
fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
b/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
index 32e8da5d19..406dbbd3dc 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
@@ -674,7 +674,7 @@ public class Backend implements Writable {
* handle Backend's heartbeat response.
* return true if any port changed, or alive state is changed.
*/
- public boolean handleHbResponse(BackendHbResponse hbResponse) {
+ public boolean handleHbResponse(BackendHbResponse hbResponse, boolean
isReplay) {
boolean isChanged = false;
if (hbResponse.getStatus() == HbStatus.OK) {
if (!this.version.equals(hbResponse.getVersion())) {
@@ -720,7 +720,8 @@ public class Backend implements Writable {
this.heartbeatFailureCounter = 0;
} else {
// Only set backend to dead if the heartbeat failure counter
exceed threshold.
- if (++this.heartbeatFailureCounter >=
Config.max_backend_heartbeat_failure_tolerance_count) {
+ // And if it is a replay process, must set backend to dead.
+ if (isReplay || ++this.heartbeatFailureCounter >=
Config.max_backend_heartbeat_failure_tolerance_count) {
if (isAlive.compareAndSet(true, false)) {
isChanged = true;
LOG.warn("{} is dead,", this.toString());
diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
b/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
index 04378e1876..dee75c08ac 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
@@ -166,7 +166,7 @@ public class HeartbeatMgr extends MasterDaemon {
BackendHbResponse hbResponse = (BackendHbResponse) response;
Backend be = nodeMgr.getBackend(hbResponse.getBeId());
if (be != null) {
- boolean isChanged = be.handleHbResponse(hbResponse);
+ boolean isChanged = be.handleHbResponse(hbResponse,
isReplay);
if (hbResponse.getStatus() != HbStatus.OK) {
// invalid all connections cached in ClientPool
ClientPool.backendPool.clearPool(new
TNetworkAddress(be.getHost(), be.getBePort()));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]