This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 34d80f6239d [fix](group commit) Fix group commit error log when
decommission (#39899) (#39955)
34d80f6239d is described below
commit 34d80f6239dee8d1a81b1c11c0185a41a32a9e05
Author: meiyi <[email protected]>
AuthorDate: Tue Aug 27 18:33:24 2024 +0800
[fix](group commit) Fix group commit error log when decommission (#39899)
(#39955)
pick https://github.com/apache/doris/pull/39899
---
.../src/main/java/org/apache/doris/alter/SystemHandler.java | 10 +++-------
.../main/java/org/apache/doris/load/GroupCommitManager.java | 6 +++---
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
b/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
index d4895dd6877..765a21dc375 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
@@ -93,8 +93,8 @@ public class SystemHandler extends AlterHandler {
}
List<Long> backendTabletIds =
invertedIndex.getTabletIdsByBackendId(beId);
- boolean hasWal = checkWal(backend);
- if (Config.drop_backend_after_decommission && checkTablets(beId,
backendTabletIds) && hasWal) {
+ long walNum =
Env.getCurrentEnv().getGroupCommitManager().getAllWalQueueSize(backend);
+ if (Config.drop_backend_after_decommission && checkTablets(beId,
backendTabletIds) && walNum == 0) {
try {
systemInfoService.dropBackend(beId);
LOG.info("no available tablet on decommission backend {},
drop it", beId);
@@ -107,7 +107,7 @@ public class SystemHandler extends AlterHandler {
LOG.info("backend {} lefts {} replicas to decommission: {}{}",
beId, backendTabletIds.size(),
backendTabletIds.subList(0, Math.min(10,
backendTabletIds.size())),
- hasWal ? "; and has unfinished WALs" : "");
+ walNum > 0 ? "; and has " + walNum + " unfinished WALs" :
"");
}
}
@@ -208,10 +208,6 @@ public class SystemHandler extends AlterHandler {
return false;
}
- private boolean checkWal(Backend backend) {
- return
Env.getCurrentEnv().getGroupCommitManager().getAllWalQueueSize(backend) == 0;
- }
-
private List<Backend> checkDecommission(DecommissionBackendClause
decommissionBackendClause)
throws DdlException {
if (decommissionBackendClause.getHostInfos().isEmpty()) {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
index b6cf6cbb0a8..f8c37d647ab 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
@@ -101,7 +101,7 @@ public class GroupCommitManager {
/**
* Check the wal before the endTransactionId is finished or not.
*/
- public boolean isPreviousWalFinished(long tableId, List<Long> aliveBeIds) {
+ private boolean isPreviousWalFinished(long tableId, List<Long> aliveBeIds)
{
boolean empty = true;
for (int i = 0; i < aliveBeIds.size(); i++) {
Backend backend =
Env.getCurrentSystemInfo().getBackend(aliveBeIds.get(i));
@@ -132,7 +132,7 @@ public class GroupCommitManager {
return size;
}
- public long getWalQueueSize(Backend backend, PGetWalQueueSizeRequest
request) {
+ private long getWalQueueSize(Backend backend, PGetWalQueueSizeRequest
request) {
PGetWalQueueSizeResponse response = null;
long expireTime = System.currentTimeMillis() +
Config.check_wal_queue_timeout_threshold;
long size = 0;
@@ -324,7 +324,7 @@ public class GroupCommitManager {
}
}
- public void updateLoadDataInternal(long tableId, long receiveData) {
+ private void updateLoadDataInternal(long tableId, long receiveData) {
if (tableToPressureMap.containsKey(tableId)) {
tableToPressureMap.get(tableId).add(receiveData);
LOG.info("Update load data for table{}, receiveData {},
tablePressureMap {}", tableId, receiveData,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]