[enhancement](memory) reduce memory usage for failed broker loads (#16974)
Reduce more memory usage for failed broker load msg in fe after pr #15895
This commit is contained in:
@ -45,6 +45,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class LoadLoadingTask extends LoadTask {
|
||||
private static final Logger LOG = LogManager.getLogger(LoadLoadingTask.class);
|
||||
@ -177,7 +178,9 @@ public class LoadLoadingTask extends LoadTask {
|
||||
curCoordinator.getLoadCounters(),
|
||||
curCoordinator.getTrackingUrl(),
|
||||
TabletCommitInfo.fromThrift(curCoordinator.getCommitInfos()),
|
||||
ErrorTabletInfo.fromThrift(curCoordinator.getErrorTabletInfos()));
|
||||
ErrorTabletInfo.fromThrift(curCoordinator.getErrorTabletInfos()
|
||||
.stream().limit(Config.max_error_tablet_of_broker_load).collect(Collectors.toList())));
|
||||
curCoordinator.getErrorTabletInfos().clear();
|
||||
// Create profile of this task and add to the job profile.
|
||||
createProfile(curCoordinator);
|
||||
} else {
|
||||
|
||||
@ -1125,7 +1125,10 @@ public class Coordinator {
|
||||
private void updateErrorTabletInfos(List<TErrorTabletInfo> errorTabletInfos) {
|
||||
lock.lock();
|
||||
try {
|
||||
this.errorTabletInfos.addAll(errorTabletInfos);
|
||||
if (this.errorTabletInfos.size() <= Config.max_error_tablet_of_broker_load) {
|
||||
this.errorTabletInfos.addAll(errorTabletInfos.stream().limit(Config.max_error_tablet_of_broker_load
|
||||
- this.errorTabletInfos.size()).collect(Collectors.toList()));
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user