Copilot commented on code in PR #9827:
URL: https://github.com/apache/ozone/pull/9827#discussion_r2852315799


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java:
##########
@@ -247,7 +247,10 @@ private static TransactionInfo getTransactionInfoFromDB(
       DBDefinition definition)
       throws IOException {
 
-    try (DBStore dbStore = DBStoreBuilder.newBuilder(tempConfig, definition, 
dbName, dbDir).build()) {
+    try (DBStore dbStore = DBStoreBuilder
+        .newBuilder(tempConfig, definition, dbName, dbDir)
+        .setOpenReadOnly(true)

Review Comment:
   Even with `setOpenReadOnly(true)`, `DBStoreBuilder.build()` will still 
create OM checkpoint/snapshot directories by default (`createCheckpointDirs` 
defaults to true in `DBStoreBuilder`, and `RDBStore` calls 
`Files.createDirectories(...)`). For checkpoint transaction-info verification 
this adds unnecessary filesystem side effects and can still fail if the 
checkpoint parent dir is not writable. Consider disabling this for this code 
path (e.g., set `createCheckpointDirs` to false on the builder) so the 
verification open is fully read-only/side-effect free.
   ```suggestion
           .setOpenReadOnly(true)
           .setCreateCheckpointDirs(false)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to