Skip to content

Conversation

@ashishkumar50
Copy link
Contributor

What changes were proposed in this pull request?

A new property “ozone.om.lease.soft.limit”(default 60s) is added to control hsync lease recover. Any request try to recover an open file which is updated within last “ozone.om.lease.soft.limit” period will be rejected.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10104

How was this patch tested?

New unit test and existing test.

throw new OMException("Open Key " + dbOpenFileKey + " not found in openKeyTable", KEY_NOT_FOUND);
}

final long leaseSoftLimit = ozoneManager.getConfiguration()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move this check before the OzoneConsts.LEASE_RECOVERY already exists check, otherwise, the second call of recoverLease will fail due to this soft limit check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved

// 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ChenSammi
Copy link
Contributor

To be compatible with HDFS behavior, we may need to introduce one more "bool force" filed in RecoverLeaseRequest, if force is true, then this soft limit will be ignored.

@ashishkumar50
Copy link
Contributor Author

To be compatible with HDFS behavior, we may need to introduce one more "bool force" filed in RecoverLeaseRequest, if force is true, then this soft limit will be ignored.

Added force option.

Assertions.assertEquals(OzoneManagerProtocolProtos.Status.OK, omResponse.getStatus());
recoverLeaseResponse = omResponse.getRecoverLeaseResponse();
keyInfo = recoverLeaseResponse.getKeyInfo();
Assertions.assertNotNull(keyInfo);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashishkumar50, could you test the both force and non-force case in this testLeaseSoftLimitForHsyncRecoverFile ? Try the Parametrized test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@ChenSammi ChenSammi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last patch looks good to me. @jojochuang , could you like to take another look?

@jojochuang jojochuang merged commit 074b6cc into apache:HDDS-7593 Jan 16, 2024
@jojochuang
Copy link
Contributor

Merged. Thanks @ashishkumar50 and @ChenSammi

jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Jan 17, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Jan 17, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Jan 17, 2024
@smengcl smengcl changed the title HDDS-10104. [hsync]Introduce soft limit support for lease recovery. HDDS-10104. [hsync] Introduce soft limit support for lease recovery Jan 22, 2024
@jojochuang jojochuang added the hbase HBase on Ozone support label Jan 23, 2024
chungen0126 pushed a commit to chungen0126/ozone that referenced this pull request May 3, 2024
chungen0126 pushed a commit to chungen0126/ozone that referenced this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hbase HBase on Ozone support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants