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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -602,17 +605,11 @@ private static void 
deleteKeysFromDelKeyTableInSnapshotScope(
    * @param store AOS or snapshot DB for uncompacted or compacted snapshot 
respectively.
    * @return a Map of (table, set of SST files corresponding to the table)
    */
-  private static Map<String, Set<String>> getSnapshotSSTFileList(RDBStore 
store)
+  private static List<LiveFileMetaData> getSnapshotSSTFileList(RDBStore store)
       throws IOException {
-    Map<String, Set<String>> sstFileList = new HashMap<>();
-    List<LiveFileMetaData> liveFileMetaDataList = 
store.getDb().getLiveFilesMetaData();
-    liveFileMetaDataList.forEach(lfm -> {
-      String cfName = StringUtils.bytes2String(lfm.columnFamilyName());
-      if (COLUMN_FAMILIES_TO_TRACK_IN_SNAPSHOT.contains(cfName)) {
-        sstFileList.computeIfAbsent(cfName, k -> new 
HashSet<>()).add(lfm.fileName());
-      }
-    });
-    return sstFileList;
+    return store.getDb().getLiveFilesMetaData().stream()

Review Comment:
   I remembered seeing a case where getLiveFilesMetaData() took too long (too 
many sst files?) and the everything came to a halt. This is used inside 
OMSnapshotCreateResponse() so if that happens it's going to slow down OM for 
sure.
   
   But I guess there's no way around it. Perhaps we can add a metric to measure 
the time spent in snapshot create response handler (do we have that already? 
not sure) so at least we know what happened.



-- 
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