captainzmc commented on a change in pull request #2938:
URL: https://github.com/apache/ozone/pull/2938#discussion_r773211179



##########
File path: 
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/RepeatedOmKeyInfo.java
##########
@@ -66,7 +68,7 @@ public static RepeatedOmKeyInfo getFromProto(RepeatedKeyInfo
    * @return
    */
   public RepeatedKeyInfo getProto(boolean compact, int clientVersion) {
-    List<KeyInfo> list = new ArrayList<>();
+    List<KeyInfo> list = new CopyOnWriteArrayList<>();
     for(OmKeyInfo k : omKeyInfoList) {

Review comment:
       Thanks @adoroszlai  can review this.
   This exception is 100% reproducible when we use FIO concurrent testing.  
Looking at the stack, we can see that it was a thread safety problem of 
RepeatedOmKeyInfo, and the problem did not reappear after this fix.
   
   I checked that a similar error had occurred in OM before, when TreeMap was 
used in OmMultipartKeyInfo:https://issues.apache.org/jira/browse/HDDS-2356
   
   Recreating this problem with UT can be complex, and currently we only 
encounter this problem with FUSE and FIO concurrent writes. We have not found 
this problem in other operations.




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