This is an automated email from the ASF dual-hosted git repository.
morrySnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new f9513abed0b [fix](mtmv) reuse Gson instance in MTMVTask.getTvfInfo to
avoid Master FE CPU spike (#66792)
f9513abed0b is described below
commit f9513abed0b076bd4e4b5e0cfc35db83c7c94f05
Author: xy720 <[email protected]>
AuthorDate: Mon Aug 17 17:27:18 2026 +0800
[fix](mtmv) reuse Gson instance in MTMVTask.getTvfInfo to avoid Master FE
CPU spike (#66792)
Reusing the Gson object can prevent repeated calls to getAdapter, avoiding
the issue where tasks('type'='mv') TVF invocations could saturate the Master
CPU in scenarios with a large number of materialized view refresh tasks running
in the cluster.
---
.../main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
index 92efad89723..553cfdc41fd 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
@@ -97,6 +97,8 @@ public class MTMVTask extends AbstractTask {
private static final Logger LOG = LogManager.getLogger(MTMVTask.class);
public static final int DEFAULT_REFRESH_PARTITION_NUM = 1;
+ private static final Gson GSON = new Gson();
+
public static final ImmutableList<Column> SCHEMA = ImmutableList.of(
new Column("TaskId", ScalarType.createStringType()),
new Column("JobId", ScalarType.createStringType()),
@@ -546,16 +548,16 @@ public class MTMVTask extends AbstractTask {
(super.getFinishTimeMs() == null || super.getFinishTimeMs() ==
0) ? FeConstants.null_string
: String.valueOf(super.getFinishTimeMs() -
super.getStartTimeMs())));
trow.addToColumnValue(new TCell()
- .setStringVal(taskContext == null ? FeConstants.null_string :
new Gson().toJson(taskContext)));
+ .setStringVal(taskContext == null ? FeConstants.null_string :
GSON.toJson(taskContext)));
trow.addToColumnValue(
new TCell().setStringVal(refreshMode == null ?
FeConstants.null_string : refreshMode.toString()));
trow.addToColumnValue(
new TCell().setStringVal(
- needRefreshPartitions == null ?
FeConstants.null_string : new Gson().toJson(
+ needRefreshPartitions == null ?
FeConstants.null_string : GSON.toJson(
needRefreshPartitions)));
trow.addToColumnValue(
new TCell().setStringVal(
- completedPartitions == null ? FeConstants.null_string
: new Gson().toJson(
+ completedPartitions == null ? FeConstants.null_string
: GSON.toJson(
completedPartitions)));
trow.addToColumnValue(
new TCell().setStringVal(getProgress()));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]