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

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

virajjasani commented on code in PR #5723:
URL: https://github.com/apache/hadoop/pull/5723#discussion_r1226918098


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreFileBaseImpl.java:
##########
@@ -400,10 +403,8 @@ public <T extends BaseRecord> StateStoreOperationResult 
putAll(
           toWrite.put(recordPath, record);
         } else if (errorIfExists) {
           LOG.error("Attempt to insert record {} that already exists", 
recordPath);
-          if (metrics != null) {
-            metrics.addFailure(monotonicNow() - start);

Review Comment:
   without this patch, it used to make sense keeping metric update logic here, 
because we were returning directly from here. but now we don't need this 
because metric update is going to take place at the end anyways (just like 
other cases).





> RBF: Fix putAll impl for mysql and file based state stores
> ----------------------------------------------------------
>
>                 Key: HDFS-17041
>                 URL: https://issues.apache.org/jira/browse/HDFS-17041
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>
> Only zookeeper based state store allows all records to be inserted even 
> though only few of them already exists and "errorIfExists" is true, however 
> file/fs as well as mysql based putAll fails the whole putAll operation 
> immediately after encountering single record that already exists in the 
> records and "errorIfExists" is provided true (which is the case while 
> inserting records for the first time).
> For all implementations, we should allow inserts of the records that do not 
> already exist and report any record as failure that already exists, rather 
> than failing the whole operation and not trying to insert valid records.



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