ChenSammi commented on code in PR #5974:
URL: https://github.com/apache/ozone/pull/5974#discussion_r1448554048
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java:
##########
@@ -297,6 +298,29 @@ public void testRecoverAbsentFile() throws Exception {
verifyTables(false, false);
}
+ @Test
+ public void testLeaseSoftLimitForHsyncRecoverFile() throws Exception {
+ populateNamespace(true, true, true, true);
+
+ // Call first time
+ OMClientResponse omClientResponse = validateAndUpdateCache();
+ // Update soft limit period to high value
+
ozoneManager.getConfiguration().set(OzoneConfigKeys.OZONE_OM_LEASE_SOFT_LIMIT,
"2s");
+ // Call second time inside soft limit, it should fail
+ omClientResponse = validateAndUpdateCache();
+ OMResponse omResponse = omClientResponse.getOMResponse();
+
Assertions.assertEquals(OzoneManagerProtocolProtos.Status.KEY_UNDER_LEASE_SOFT_LIMIT_PERIOD,
Review Comment:
The second call should success. The soft limit period is to prevent
recoveror to recover the client too soon when there is still client writing to
this file. When the file is already under recovery, the soft limit period
will have no use.
--
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]