Skip to content

Commit 9abac5c

Browse files
authored
Fix the config 'query_cost_stat_window' cannot be hot loaded #16896
1 parent c722aaf commit 9abac5c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/informationschema/IoTDBCurrentQueriesIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public class IoTDBCurrentQueriesIT {
6464

6565
@BeforeClass
6666
public static void setUp() throws Exception {
67-
EnvFactory.getEnv().getConfig().getDataNodeConfig().setQueryCostStatWindow(1);
6867
EnvFactory.getEnv().initClusterEnvironment();
6968
createUser("test", "test123123456");
7069
}
@@ -81,6 +80,7 @@ public void testCurrentQueries() {
8180
EnvFactory.getEnv().getConnection(ADMIN_NAME, ADMIN_PWD, BaseEnv.TABLE_SQL_DIALECT);
8281
Statement statement = connection.createStatement();
8382
statement.execute("USE information_schema");
83+
statement.execute("set configuration \"query_cost_stat_window\"='1'");
8484

8585
// 1. query current_queries table
8686
String sql = "SELECT * FROM current_queries";

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,12 @@ public synchronized void loadHotModifiedProps(TrimProperties properties)
20342034
properties.getProperty(
20352035
"slow_query_threshold",
20362036
ConfigurationFileUtils.getConfigurationDefaultValue("slow_query_threshold"))));
2037+
// update query_cost_stat_window
2038+
conf.setQueryCostStatWindow(
2039+
Integer.parseInt(
2040+
properties.getProperty(
2041+
"query_cost_stat_window",
2042+
ConfigurationFileUtils.getConfigurationDefaultValue("query_cost_stat_window"))));
20372043
// update select into operation max buffer size
20382044
conf.setIntoOperationBufferSizeInByte(
20392045
Long.parseLong(

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/ConfigExecution.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ public String getUser() {
354354
return context.getSession().getUserName();
355355
}
356356

357+
@Override
357358
public String getClientHostname() {
358359
return context.getCliHostname();
359360
}

0 commit comments

Comments
 (0)