[ 
https://issues.apache.org/jira/browse/HDFS-17529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17848881#comment-17848881
 ] 

ASF GitHub Bot commented on HDFS-17529:
---------------------------------------

ZanderXu commented on code in PR #6833:
URL: https://github.com/apache/hadoop/pull/6833#discussion_r1611258872


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/CachedRecordStore.java:
##########
@@ -198,8 +195,15 @@ public void overrideExpiredRecords(QueryResult<R> query) 
throws IOException {
     if (commitRecords.size() > 0) {
       getDriver().putAll(commitRecords, true, false);
     }
-    if (deleteRecords.size() > 0) {
-      newRecords.removeAll(deleteRecords);
+    if (!toDeleteRecords.isEmpty()) {
+      for (Map.Entry<R, Boolean> entry : 
getDriver().removeMultiple(toDeleteRecords).entrySet()) {
+        if (entry.getValue()) {
+          deletedRecords.add(entry.getKey());

Review Comment:
   Here changing to `newRecords.remove(entry.getKey())`, we can remove  
`deletedRecords`.





> RBF: Improve router state store cache entry deletion
> ----------------------------------------------------
>
>                 Key: HDFS-17529
>                 URL: https://issues.apache.org/jira/browse/HDFS-17529
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs, rbf
>            Reporter: Felix N
>            Assignee: Felix N
>            Priority: Major
>              Labels: pull-request-available
>
> Current implementation for router state store update is quite inefficient, so 
> much that when routers are removed and a lot of NameNodeMembership records 
> are deleted in a short burst, the deletions triggered a router safemode in 
> our cluster and caused a lot of troubles.
> This ticket aims to improve the deletion process for ZK state store 
> implementation.
> See HDFS-17532 for the other half of this improvement



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to