Re: [PR] Add hot reload for IoTConsensus transit snapshot rate limiter and fix init [iotdb]

2024-04-28 Thread via GitHub


OneSizeFitsQuorum merged PR #12430:
URL: https://github.com/apache/iotdb/pull/12430


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Add hot reload for IoTConsensus transit snapshot rate limiter and fix init [iotdb]

2024-04-28 Thread via GitHub


OneSizeFitsQuorum commented on code in PR #12430:
URL: https://github.com/apache/iotdb/pull/12430#discussion_r1582054253


##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java:
##
@@ -1052,6 +1053,11 @@ public void loadProperties(Properties properties) throws 
BadNodeUrlException, IO
 loadIoTConsensusProps(properties);
   }
 
+  private void reloadIoTConsensusProps(Properties properties) {

Review Comment:
   reloadConsensusProps



##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java:
##
@@ -1052,6 +1053,11 @@ public void loadProperties(Properties properties) throws 
BadNodeUrlException, IO
 loadIoTConsensusProps(properties);
   }
 
+  private void reloadIoTConsensusProps(Properties properties) {
+loadIoTConsensusProps(properties);

Review Comment:
   Circular call?



##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/DataRegionConsensusImpl.java:
##
@@ -61,9 +61,15 @@ public static void reinitializeStatics() {
 
DataRegionConsensusImpl.DataRegionConsensusImplHolder.reinitializeStatics();
   }
 
+  public static void reloadConsensusConfig(IoTDBConfig conf) {
+DataRegionConsensusImpl.DataRegionConsensusImplHolder.CONF = conf;
+ConsensusConfig consensusConfig = 
DataRegionConsensusImplHolder.buildConsensusConfig();
+getInstance().reloadConsensusConfig(consensusConfig);
+  }
+
   private static class DataRegionConsensusImplHolder {
 
-private static final IoTDBConfig CONF = 
IoTDBDescriptor.getInstance().getConfig();
+private static IoTDBConfig CONF = 
IoTDBDescriptor.getInstance().getConfig();

Review Comment:
   why remove final?



##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java:
##
@@ -1052,6 +1053,11 @@ public void loadProperties(Properties properties) throws 
BadNodeUrlException, IO
 loadIoTConsensusProps(properties);
   }
 
+  private void reloadIoTConsensusProps(Properties properties) {
+loadIoTConsensusProps(properties);
+DataRegionConsensusImpl.reloadConsensusConfig(conf);

Review Comment:
   no need to pass conf,just call 
DataRegionConsensusImpl.reloadConsensusConfig() is ok? DataRegionConsensusImpl 
can use config to reproduce related confs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org