pick https://github.com/apache/doris/pull/39899
This commit is contained in:
@ -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()) {
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user