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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1882,10 +1885,12 @@ public ExpiredOpenKeys getExpiredOpenKeys(Duration 
expireThreshold,
               .filter(id -> id.equals(clientIdString))
               .isPresent();
 
-          if (!isHsync) {
+          if (!isHsync && openKeyInfo.getCreationTime() <= 
expiredCreationTimestamp) {
             // add non-hsync'ed keys
             expiredKeys.addOpenKey(openKeyInfo, dbOpenKeyName);
-          } else {
+            num++;
+          } else if (isHsync && openKeyInfo.getModificationTime() <= 
expiredLeaseTimestamp &&
+              
!openKeyInfo.getMetadata().containsKey(OzoneConsts.LEASE_RECOVERY)) {

Review Comment:
   ```suggestion
             } else if (isHsync && openKeyInfo.getModificationTime() <= 
expiredLeaseTimestamp) {
   ```
   What if the client performing lease recovery crashes before committing the 
final change? The file would become recovery-in-progress forever and can't be 
closed.



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