You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "swamirishi (via GitHub)" <gi...@apache.org> on 2024/02/06 18:15:07 UTC

Re: [PR] HDDS-10156. Optimize Snapshot Cache get and eviction [ozone]

swamirishi commented on code in PR #6024:
URL: https://github.com/apache/ozone/pull/6024#discussion_r1480359691


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########
@@ -237,8 +242,9 @@ private synchronized void cleanup() {
    * TODO: [SNAPSHOT] Add new ozone debug CLI command to trigger this directly.
    */
   private void cleanupInternal() {
-    for (Map.Entry<String, ReferenceCounted<IOmMetadataReader, SnapshotCache>> entry : dbMap.entrySet()) {
-      dbMap.compute(entry.getKey(), (k, v) -> {
+    for (String evictionKey : pendingEvictionQueue) {
+      dbMap.compute(evictionKey, (k, v) -> {
+        pendingEvictionQueue.remove(k);

Review Comment:
   this should be fine, since this is a concurrent hashset.



-- 
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-unsubscribe@ozone.apache.org

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


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