Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](stats) Don't save colToPartitions anymore to save mem #27879

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ public enum ScheduleType {
public final long tblId;

// TODO: Map here is wired, List is enough
@SerializedName("colToPartitions")
public final Map<String, Set<String>> colToPartitions;

@SerializedName("partitionNames")
public final Set<String> partitionNames;

@SerializedName("colName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ public void cancel() {

public void deregisterJob() {
analysisManager.removeJob(jobInfo.jobId);
for (BaseAnalysisTask task : queryingTask) {
task.info.colToPartitions.clear();
if (task.info.partitionNames != null) {
task.info.partitionNames.clear();
}
}
for (BaseAnalysisTask task : queryFinished) {
task.info.colToPartitions.clear();
if (task.info.partitionNames != null) {
task.info.partitionNames.clear();
}
}
}

protected void syncLoadStats() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,10 @@ public void updateTableStats(AnalysisInfo jobInfo) {
tableStats.update(jobInfo, tbl);
logCreateTableStats(tableStats);
}

jobInfo.colToPartitions.clear();
if (jobInfo.partitionNames != null) {
jobInfo.partitionNames.clear();
}
}

public List<AnalysisInfo> showAnalysisJob(ShowAnalyzeStmt stmt) {
Expand Down Expand Up @@ -801,13 +804,19 @@ public void replayCreateAnalysisJob(AnalysisInfo jobInfo) {
while (analysisJobInfoMap.size() >= Config.analyze_record_limit) {
analysisJobInfoMap.remove(analysisJobInfoMap.pollFirstEntry().getKey());
}
if (jobInfo.message != null && jobInfo.message.length() >= StatisticConstants.MSG_LEN_UPPER_BOUND) {
jobInfo.message = jobInfo.message.substring(0, StatisticConstants.MSG_LEN_UPPER_BOUND);
}
this.analysisJobInfoMap.put(jobInfo.jobId, jobInfo);
}

public void replayCreateAnalysisTask(AnalysisInfo taskInfo) {
while (analysisTaskInfoMap.size() >= Config.analyze_record_limit) {
analysisTaskInfoMap.remove(analysisTaskInfoMap.pollFirstEntry().getKey());
}
if (taskInfo.message != null && taskInfo.message.length() >= StatisticConstants.MSG_LEN_UPPER_BOUND) {
taskInfo.message = taskInfo.message.substring(0, StatisticConstants.MSG_LEN_UPPER_BOUND);
}
this.analysisTaskInfoMap.put(taskInfo.taskId, taskInfo);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public class StatisticConstants {

public static final int AUTO_ANALYZE_TABLE_WIDTH_THRESHOLD = 70;

public static final int MSG_LEN_UPPER_BOUND = 1024;

static {
SYSTEM_DBS.add(SystemInfoService.DEFAULT_CLUSTER
+ ClusterNamespace.CLUSTER_DELIMITER + FeConstants.INTERNAL_DB_NAME);
Expand Down