From 85935efbe28227f28144c2a4dbc10449df7d27a6 Mon Sep 17 00:00:00 2001 From: "zihe.liu" Date: Thu, 5 Sep 2024 19:38:43 +0800 Subject: [PATCH 1/4] wip Signed-off-by: zihe.liu --- .../proc/CurrentQueryStatisticsProcDir.java | 1 + .../com/starrocks/qe/DefaultCoordinator.java | 7 +++++ .../com/starrocks/qe/QeProcessorImpl.java | 4 ++- .../com/starrocks/qe/QueryStatisticsInfo.java | 29 +++++++++++++++---- .../com/starrocks/qe/QueryStatisticsItem.java | 12 ++++++++ .../starrocks/qe/scheduler/Coordinator.java | 2 ++ .../qe/scheduler/FeExecuteCoordinator.java | 5 ++++ ...rrentGlobalQueryStatisticsProcDirTest.java | 12 +++++--- .../CurrentQueryStatisticsProcDirTest.java | 6 ++++ .../starrocks/qe/QueryStatisticsInfoTest.java | 3 +- gensrc/thrift/FrontendService.thrift | 1 + 11 files changed, 70 insertions(+), 12 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDir.java b/fe/fe-core/src/main/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDir.java index aa37c64ca19b6..575bd96721811 100644 --- a/fe/fe-core/src/main/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDir.java +++ b/fe/fe-core/src/main/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDir.java @@ -67,6 +67,7 @@ public class CurrentQueryStatisticsProcDir implements ProcDirInterface { .add("ExecTime") .add("Warehouse") .add("CustomQueryId") + .add("ResourceGroup") .build(); @Override diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/DefaultCoordinator.java b/fe/fe-core/src/main/java/com/starrocks/qe/DefaultCoordinator.java index 78b16857ffa19..2df0906165666 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/DefaultCoordinator.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/DefaultCoordinator.java @@ -41,6 +41,7 @@ import com.starrocks.analysis.DescriptorTable; import com.starrocks.authentication.AuthenticationMgr; import com.starrocks.catalog.FsBroker; +import com.starrocks.catalog.ResourceGroup; import com.starrocks.common.AnalysisException; import com.starrocks.common.Config; import com.starrocks.common.FeConstants; @@ -1287,6 +1288,12 @@ public String getWarehouseName() { return connectContext.getSessionVariable().getWarehouseName(); } + @Override + public String getResourceGroupName() { + return jobSpec.getResourceGroup() == null ? ResourceGroup.DEFAULT_RESOURCE_GROUP_NAME : + jobSpec.getResourceGroup().getName(); + } + private void execShortCircuit() throws Exception { shortCircuitExecutor.exec(); } diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java b/fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java index 5ef045a3a7072..6e3e11cee0bbe 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java @@ -176,7 +176,9 @@ public Map getQueryStatistics() { .db(context.getDatabase()) .fragmentInstanceInfos(info.getCoord().getFragmentInstanceInfos()) .profile(info.getCoord().getQueryProfile()) - .warehouseName(info.coord.getWarehouseName()).build(); + .warehouseName(info.coord.getWarehouseName()) + .resourceGroupName(info.coord.getResourceGroupName()) + .build(); querySet.put(queryIdStr, item); } diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsInfo.java b/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsInfo.java index b4db288572df5..801cd56d3ab23 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsInfo.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsInfo.java @@ -63,13 +63,14 @@ public class QueryStatisticsInfo { private long execTime; private String wareHouseName; private String customQueryId; + private String resourceGroupName; public QueryStatisticsInfo() { } public QueryStatisticsInfo(long queryStartTime, String feIp, String queryId, String connId, String db, String user, long cpuCostNs, long scanBytes, long scanRows, long memUsageBytes, long spillBytes, - long execTime, String wareHouseName, String customQueryId) { + long execTime, String wareHouseName, String customQueryId, String resourceGroupName) { this.queryStartTime = queryStartTime; this.feIp = feIp; this.queryId = queryId; @@ -84,6 +85,7 @@ public QueryStatisticsInfo(long queryStartTime, String feIp, String queryId, Str this.execTime = execTime; this.wareHouseName = wareHouseName; this.customQueryId = customQueryId; + this.resourceGroupName = resourceGroupName; } public long getQueryStartTime() { @@ -138,6 +140,10 @@ public String getWareHouseName() { return wareHouseName; } + public String getResourceGroupName() { + return resourceGroupName; + } + public String getCustomQueryId() { return customQueryId; } @@ -207,6 +213,11 @@ public QueryStatisticsInfo withWareHouseName(String warehouseName) { return this; } + public QueryStatisticsInfo withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + public QueryStatisticsInfo withCustomQueryId(String customQueryId) { this.customQueryId = customQueryId; return this; @@ -227,7 +238,8 @@ public TQueryStatisticsInfo toThrift() { .setSpillBytes(spillBytes) .setExecTime(execTime) .setWareHouseName(wareHouseName) - .setCustomQueryId(customQueryId); + .setCustomQueryId(customQueryId) + .setResourceGroupName(resourceGroupName); } public static QueryStatisticsInfo fromThrift(TQueryStatisticsInfo tinfo) { @@ -245,7 +257,8 @@ public static QueryStatisticsInfo fromThrift(TQueryStatisticsInfo tinfo) { .withCpuCostNs(tinfo.getCpuCostNs()) .withExecTime(tinfo.getExecTime()) .withWareHouseName(tinfo.getWareHouseName()) - .withCustomQueryId(tinfo.getCustomQueryId()); + .withCustomQueryId(tinfo.getCustomQueryId()) + .withResourceGroupName(tinfo.getResourceGroupName()); } public List formatToList() { @@ -264,6 +277,7 @@ public List formatToList() { values.add(QueryStatisticsFormatter.getSecondsFromMilli(this.getExecTime())); values.add(this.getWareHouseName()); values.add(this.getCustomQueryId()); + values.add(this.getResourceGroupName()); return values; } @@ -281,13 +295,14 @@ public boolean equals(Object o) { Objects.equals(db, that.db) && Objects.equals(user, that.user) && cpuCostNs == that.cpuCostNs && scanBytes == that.scanBytes && scanRows == that.scanRows && memUsageBytes == that.memUsageBytes && spillBytes == that.spillBytes && execTime == that.execTime && - Objects.equals(wareHouseName, that.wareHouseName) && Objects.equals(customQueryId, that.customQueryId); + Objects.equals(wareHouseName, that.wareHouseName) && Objects.equals(customQueryId, that.customQueryId) && + Objects.equals(resourceGroupName, that.resourceGroupName); } @Override public int hashCode() { return Objects.hash(queryStartTime, feIp, queryId, connId, db, user, cpuCostNs, scanBytes, scanRows, memUsageBytes, - spillBytes, execTime, wareHouseName, customQueryId); + spillBytes, execTime, wareHouseName, customQueryId, resourceGroupName); } @Override @@ -306,6 +321,7 @@ public String toString() { ", execTime=" + execTime + ", wareHouseName=" + wareHouseName + ", customQueryId=" + customQueryId + + ", resourceGroupName=" + resourceGroupName + '}'; } @@ -341,7 +357,8 @@ public static List makeListFromMetricsAndMgrs() throws Anal .withCpuCostNs(statistics.getCpuCostNs()) .withExecTime(item.getQueryExecTime()) .withWareHouseName(item.getWarehouseName()) - .withCustomQueryId(item.getCustomQueryId()); + .withCustomQueryId(item.getCustomQueryId()) + .withResourceGroupName(item.getResourceGroupName()); sortedRowData.add(info); } diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsItem.java b/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsItem.java index 61bfd63eadc7b..efe2617cfd90d 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsItem.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/QueryStatisticsItem.java @@ -38,6 +38,7 @@ public final class QueryStatisticsItem { private final RuntimeProfile queryProfile; private final TUniqueId executionId; private final String warehouseName; + private final String resourceGroupName; private QueryStatisticsItem(Builder builder) { this.customQueryId = builder.customQueryId; @@ -51,6 +52,7 @@ private QueryStatisticsItem(Builder builder) { this.queryProfile = builder.queryProfile; this.executionId = builder.executionId; this.warehouseName = builder.warehouseName; + this.resourceGroupName = builder.resourceGroupName; } public String getDb() { @@ -102,6 +104,10 @@ public String getWarehouseName() { return warehouseName; } + public String getResourceGroupName() { + return resourceGroupName; + } + public static final class Builder { private String customQueryId; private String queryId; @@ -114,6 +120,7 @@ public static final class Builder { private RuntimeProfile queryProfile; private TUniqueId executionId; private String warehouseName; + private String resourceGroupName; public Builder() { fragmentInstanceInfos = Lists.newArrayList(); @@ -174,6 +181,11 @@ public Builder warehouseName(String warehouseName) { return this; } + public Builder resourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + public QueryStatisticsItem build() { initDefaultValue(this); return new QueryStatisticsItem(this); diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/Coordinator.java b/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/Coordinator.java index 8eb82accb1d27..262ce185db141 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/Coordinator.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/Coordinator.java @@ -243,5 +243,7 @@ public static List getCommitInfos(Coordinator coord) { public abstract String getWarehouseName(); + public abstract String getResourceGroupName(); + public abstract boolean isShortCircuit(); } diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/FeExecuteCoordinator.java b/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/FeExecuteCoordinator.java index 108e7e88cd665..651a544c5d4cd 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/FeExecuteCoordinator.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/scheduler/FeExecuteCoordinator.java @@ -303,6 +303,11 @@ public String getWarehouseName() { return connectContext.getSessionVariable().getWarehouseName(); } + @Override + public String getResourceGroupName() { + return ""; + } + public boolean isShortCircuit() { return false; } diff --git a/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentGlobalQueryStatisticsProcDirTest.java b/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentGlobalQueryStatisticsProcDirTest.java index b97f18e5f1d8e..359abd32b7562 100644 --- a/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentGlobalQueryStatisticsProcDirTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentGlobalQueryStatisticsProcDirTest.java @@ -48,7 +48,8 @@ public class CurrentGlobalQueryStatisticsProcDirTest { .withCpuCostNs(97323000) .withExecTime(3533000) .withWareHouseName("default_warehouse") - .withCustomQueryId(""); + .withCustomQueryId("") + .withResourceGroupName("wg1"); public static final QueryStatisticsInfo QUERY_TWO_LOCAL = new QueryStatisticsInfo() @@ -65,7 +66,8 @@ public class CurrentGlobalQueryStatisticsProcDirTest { .withCpuCostNs(96576000) .withExecTime(2086000) .withWareHouseName("default_warehouse") - .withCustomQueryId(""); + .withCustomQueryId("") + .withResourceGroupName("wg2"); public static final QueryStatisticsInfo QUERY_ONE_REMOTE = new QueryStatisticsInfo() .withQueryStartTime(1721866428) @@ -81,7 +83,8 @@ public class CurrentGlobalQueryStatisticsProcDirTest { .withCpuCostNs(97456000) .withExecTime(3687000) .withWareHouseName("default_warehouse") - .withCustomQueryId(""); + .withCustomQueryId("") + .withResourceGroupName("wg3"); public static final QueryStatisticsInfo QUERY_TWO_REMOTE = new QueryStatisticsInfo() @@ -98,7 +101,8 @@ public class CurrentGlobalQueryStatisticsProcDirTest { .withCpuCostNs(96686000) .withExecTime(2196000) .withWareHouseName("default_warehouse") - .withCustomQueryId(""); + .withCustomQueryId("") + .withResourceGroupName("wg"); public static List LOCAL_TEST_QUERIES = new ArrayList<>(List.of(QUERY_ONE_LOCAL, QUERY_TWO_LOCAL)); diff --git a/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDirTest.java b/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDirTest.java index 4295baa691784..399842cca5daa 100644 --- a/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDirTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/common/proc/CurrentQueryStatisticsProcDirTest.java @@ -45,6 +45,7 @@ public void testFetchResult() throws AnalysisException { .customQueryId("abc1") .queryId("queryId1") .warehouseName("wh1") + .resourceGroupName("wg1") .build() ); statistic.put("queryId2", new QueryStatisticsItem.Builder() @@ -52,6 +53,7 @@ public void testFetchResult() throws AnalysisException { .customQueryId("abc2") .queryId("queryId2") .warehouseName("wh1") + .resourceGroupName("wg2") .build() ); new MockUp() { @@ -80,6 +82,8 @@ public Map getQueryStatistics( Assert.assertEquals("wh1", list1.get(12)); // CustomQueryId Assert.assertEquals("abc1", list1.get(13)); + // ResourceGroupName + Assert.assertEquals("wg1", list1.get(14)); List list2 = rows.get(1); Assert.assertEquals(list2.size(), CurrentQueryStatisticsProcDir.TITLE_NAMES.size()); @@ -89,6 +93,8 @@ public Map getQueryStatistics( Assert.assertEquals("wh1", list2.get(12)); // CustomQueryId Assert.assertEquals("abc2", list2.get(13)); + // ResourceGroupName + Assert.assertEquals("wg2", list2.get(14)); } @Test diff --git a/fe/fe-core/src/test/java/com/starrocks/qe/QueryStatisticsInfoTest.java b/fe/fe-core/src/test/java/com/starrocks/qe/QueryStatisticsInfoTest.java index 94b639b7b98cd..5c2668710a60d 100644 --- a/fe/fe-core/src/test/java/com/starrocks/qe/QueryStatisticsInfoTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/qe/QueryStatisticsInfoTest.java @@ -39,7 +39,8 @@ public void testEquality() { firstQuery.getSpillBytes(), firstQuery.getExecTime(), firstQuery.getWareHouseName(), - firstQuery.getCustomQueryId() + firstQuery.getCustomQueryId(), + firstQuery.getResourceGroupName() ); Assert.assertEquals(firstQuery, otherQuery); Assert.assertEquals(firstQuery.hashCode(), otherQuery.hashCode()); diff --git a/gensrc/thrift/FrontendService.thrift b/gensrc/thrift/FrontendService.thrift index c7841460494db..6a7dba6d5c65b 100644 --- a/gensrc/thrift/FrontendService.thrift +++ b/gensrc/thrift/FrontendService.thrift @@ -1584,6 +1584,7 @@ struct TQueryStatisticsInfo { 12: optional i64 execTime 13: optional string wareHouseName 14: optional string customQueryId + 15: optional string resourceGroupName } struct TGetQueryStatisticsResponse { From e91cf30512b0330e01b902d3538a2656ffa1acaa Mon Sep 17 00:00:00 2001 From: "zihe.liu" Date: Fri, 6 Sep 2024 10:23:06 +0800 Subject: [PATCH 2/4] add ut Signed-off-by: zihe.liu --- .../java/com/starrocks/qe/scheduler/JobSpecTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fe/fe-core/src/test/java/com/starrocks/qe/scheduler/JobSpecTest.java b/fe/fe-core/src/test/java/com/starrocks/qe/scheduler/JobSpecTest.java index af6575489a5f6..552c1e0f9eb42 100644 --- a/fe/fe-core/src/test/java/com/starrocks/qe/scheduler/JobSpecTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/qe/scheduler/JobSpecTest.java @@ -21,12 +21,15 @@ import com.starrocks.catalog.ResourceGroupClassifier; import com.starrocks.catalog.ResourceGroupMgr; import com.starrocks.common.Config; +import com.starrocks.common.util.DebugUtil; import com.starrocks.load.loadv2.BulkLoadJob; import com.starrocks.planner.PlanFragment; import com.starrocks.planner.ScanNode; import com.starrocks.planner.StreamLoadPlanner; import com.starrocks.qe.ConnectContext; import com.starrocks.qe.DefaultCoordinator; +import com.starrocks.qe.QeProcessorImpl; +import com.starrocks.qe.QueryStatisticsItem; import com.starrocks.qe.SessionVariable; import com.starrocks.qe.scheduler.dag.JobSpec; import com.starrocks.server.WarehouseManager; @@ -118,6 +121,12 @@ public void testFromQuerySpec() throws Exception { connectContext, fragments, scanNodes, descTable.toThrift()); JobSpec jobSpec = coordinator.getJobSpec(); + QeProcessorImpl.INSTANCE.registerQuery(queryId, new QeProcessorImpl.QueryInfo(connectContext, sql, coordinator)); + Map queryStatistics = QeProcessorImpl.INSTANCE.getQueryStatistics(); + assertThat(queryStatistics).hasSize(1); + assertThat(queryStatistics.get(DebugUtil.printId(queryId)).getResourceGroupName()) + .isEqualTo(QUERY_RESOURCE_GROUP.getName()); + // Check created jobSpec. Assert.assertEquals(queryId, jobSpec.getQueryId()); Assert.assertEquals(lastQueryId.toString(), jobSpec.getQueryGlobals().getLast_query_id()); From 19194f3d8d761ed2e4616879228082a442f25f98 Mon Sep 17 00:00:00 2001 From: "zihe.liu" Date: Fri, 6 Sep 2024 13:55:41 +0800 Subject: [PATCH 3/4] fix: getAvgNumHardwareCoresOfBe -> getMinNumHardwareCoresOfBe Signed-off-by: zihe.liu --- .../src/main/java/com/starrocks/catalog/ResourceGroupMgr.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java b/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java index 2f2d4f31f419c..6137b549c3b5c 100644 --- a/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java +++ b/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java @@ -359,10 +359,10 @@ public void alterResourceGroup(AlterResourceGroupStmt stmt) throws DdlException if (exclusiveCpuCores != null && exclusiveCpuCores > 0) { if (sumExclusiveCpuCores + exclusiveCpuCores - wg.getNormalizedExclusiveCpuCores() >= - BackendResourceStat.getInstance().getAvgNumHardwareCoresOfBe()) { + BackendResourceStat.getInstance().getMinNumHardwareCoresOfBe()) { throw new DdlException(String.format(EXCEED_TOTAL_EXCLUSIVE_CPU_CORES_ERR_MSG, ResourceGroup.EXCLUSIVE_CPU_CORES, - BackendResourceStat.getInstance().getAvgNumHardwareCoresOfBe() - 1)); + BackendResourceStat.getInstance().getMinNumHardwareCoresOfBe() - 1)); } if (wg.getResourceGroupType() == TWorkGroupType.WG_SHORT_QUERY) { throw new SemanticException(SHORT_QUERY_SET_EXCLUSIVE_CPU_CORES_ERR_MSG); From 889acd2b04918f81d85b80a4488506abf933dd2f Mon Sep 17 00:00:00 2001 From: "zihe.liu" Date: Fri, 6 Sep 2024 16:36:20 +0800 Subject: [PATCH 4/4] update Signed-off-by: zihe.liu --- .../java/com/starrocks/catalog/ResourceGroupMgr.java | 4 ++++ .../starrocks/analysis/ResourceGroupStmtTest.java | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java b/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java index 6137b549c3b5c..693d8b3aecee5 100644 --- a/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java +++ b/fe/fe-core/src/main/java/com/starrocks/catalog/ResourceGroupMgr.java @@ -148,6 +148,10 @@ public void createResourceGroup(CreateResourceGroupStmt stmt) throws DdlExceptio dropResourceGroupUnlocked(wg.getName()); } + if (wg.getCpuWeight() == null) { + wg.setCpuWeight(0); + } + if (ResourceGroup.DEFAULT_RESOURCE_GROUP_NAME.equals(wg.getName())) { wg.setId(ResourceGroup.DEFAULT_WG_ID); } else if (ResourceGroup.DEFAULT_MV_RESOURCE_GROUP_NAME.equals(wg.getName())) { diff --git a/fe/fe-core/src/test/java/com/starrocks/analysis/ResourceGroupStmtTest.java b/fe/fe-core/src/test/java/com/starrocks/analysis/ResourceGroupStmtTest.java index 434385d0d106f..b403f109c6046 100644 --- a/fe/fe-core/src/test/java/com/starrocks/analysis/ResourceGroupStmtTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/analysis/ResourceGroupStmtTest.java @@ -1436,7 +1436,7 @@ public void testGetDedicateCpuCores() throws Exception { assertThat(rowsToString(rows)).isEqualTo("default_mv_wg|1|0|80.0%|0|0|0|null|80%|(weight=0.0)\n" + "default_wg|32|0|100.0%|0|0|0|null|100%|(weight=0.0)\n" + "rg1|17|0|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)\n" + - "rg2|null|16|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)\n" + + "rg2|0|16|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)\n" + "rt_rg1|15|15|20.0%|0|0|0|null|100%|(weight=1.0, user=rt_rg1_user)"); starRocksAssert.executeResourceGroupDdlSql("DROP RESOURCE GROUP rg1"); @@ -1554,7 +1554,7 @@ public void testValidateCpuParametersForCreate() throws Exception { List> rows = starRocksAssert.executeResourceGroupShowSql("show resource groups all"); assertThat(rowsToString(rows)).isEqualTo("default_mv_wg|1|0|80.0%|0|0|0|null|80%|(weight=0.0)\n" + "default_wg|32|0|100.0%|0|0|0|null|100%|(weight=0.0)\n" + - "rg1|null|17|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)"); + "rg1|0|17|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)"); starRocksAssert.executeResourceGroupDdlSql("DROP RESOURCE GROUP rg1"); } } @@ -1720,8 +1720,8 @@ public void testValidateSumExclusiveCpuCores() throws Exception { List> rows = starRocksAssert.executeResourceGroupShowSql("show resource groups all"); assertThat(rowsToString(rows)).isEqualTo("default_mv_wg|1|0|80.0%|0|0|0|null|80%|(weight=0.0)\n" + "default_wg|32|0|100.0%|0|0|0|null|100%|(weight=0.0)\n" + - "rg1|null|16|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)\n" + - "rg2|null|15|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)"); + "rg1|0|16|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)\n" + + "rg2|0|15|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)"); } { @@ -1745,8 +1745,8 @@ public void testValidateSumExclusiveCpuCores() throws Exception { List> rows = starRocksAssert.executeResourceGroupShowSql("show resource groups all"); assertThat(rowsToString(rows)).isEqualTo("default_mv_wg|1|0|80.0%|0|0|0|null|80%|(weight=0.0)\n" + "default_wg|32|0|100.0%|0|0|0|null|100%|(weight=0.0)\n" + - "rg1|null|14|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)\n" + - "rg2|null|15|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)"); + "rg1|0|14|20.0%|0|0|0|null|100%|(weight=1.0, user=rg1_user)\n" + + "rg2|0|15|20.0%|0|0|0|null|100%|(weight=1.0, user=rg2_user)"); } {