jojochuang commented on code in PR #8707:
URL: https://github.com/apache/ozone/pull/8707#discussion_r2199325887


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -548,4 +549,30 @@ public <T> void buildMissingContainerSetAndValidate(Map<T, 
Long> container2BCSID
       }
     });
   }
+
+  /**
+   * Dump container metadata cache for a volume to reduce startup time.
+   */
+  public void dumpContainerCache(Iterable<? extends HddsVolume> volumes,
+                               ConfigurationSource config) {
+    ContainerStartupCache containerCache = new ContainerStartupCache();
+
+    // Set dump in progress flag to prevent YAML modifications
+    ContainerDataYaml.setDisableWrite(true);
+
+    try {
+      for (HddsVolume volume : volumes) {
+        try {
+          containerCache.dumpContainerCache(
+              containerMap.values(), volume, config);
+        } catch (IOException e) {
+          LOG.warn("Failed to dump container cache for volume {}",

Review Comment:
   is it appropriate to log and ignore the error?



##########
hadoop-hdds/common/src/main/resources/ozone-default.xml:
##########
@@ -218,6 +218,16 @@
       This volume choosing policy randomly chooses two volumes with remaining 
space and then picks the one with lower utilization.
     </description>
   </property>
+  <property>
+    <name>hdds.datanode.container.startup.cache.enabled</name>
+    <value>false</value>
+    <tag>OZONE, CONTAINER, DATANODE</tag>
+    <description>
+      Enable container metadata startup cache to improve DataNode boot 
performance.
+      When enabled, container YAML file content is cached during
+      shutdown and loaded during startup, reducing random I/O operations.

Review Comment:
   ```suggestion
         shutdown and loaded during startup, reducing random I/O operations.
         Recommended if Datanode data volumes are mounted on spindle disks and 
with many containers.
   ```



-- 
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: issues-unsubscr...@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to