ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-7258. Cleanup the allocated but uncommitted blocks

Open Xushaohong opened this issue 2 years ago • 7 comments

What changes were proposed in this pull request?

We found that the blocks the client committed may not be equal to the allocated(when EC stripe fails), and the uncommitted blocks would remain forever as orphan blocks as no key maps to them anymore.

Here I use a tricky solution that considers these blocks as repeated/ overwritten key blocks, and thus they would be deleted in the existing deletion path.


https://docs.google.com/document/d/1Oi1zPKdmvA7DFwIcUWz6zw_p-pY3D1L76gyV37jQT94/edit#

The prototype of the design.

What is the link to the Apache JIRA

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

How was this patch tested?

UT and Manual test in the test environment.

Xushaohong avatar Sep 26 '22 04:09 Xushaohong

Could you please describe how these blocks are being detected in the PR description - like a small design overview?

sodonnel avatar Sep 26 '22 17:09 sodonnel

Could you please describe how these blocks are being detected in the PR description - like a small design overview?

Sure, will update later, I am working on fixing some issues found by UT.

Xushaohong avatar Sep 27 '22 08:09 Xushaohong

https://docs.google.com/document/d/1Oi1zPKdmvA7DFwIcUWz6zw_p-pY3D1L76gyV37jQT94/edit#

The prototype of the design.

Xushaohong avatar Sep 27 '22 12:09 Xushaohong

Thanks for the work @Xushaohong. Is it possible to delete those blocks directly instead of relying on OpenKeyCleanupService? I'm worrying about too much coupling here.

kaijchen avatar Oct 08 '22 06:10 kaijchen

Thx for the question~ @kaijchen The case for OpenKeyCleanupService is not related to the logic here. They should be two cases as I mentioned in the DOC.

Xushaohong avatar Oct 08 '22 06:10 Xushaohong

Thx for the question~ @kaijchen The case for OpenKeyCleanupService is not related to the logic here. They should be two cases as I mentioned in the DOC.

Sorry I misread your purposal. The pseudoKeyInfo is moved into DeleteKeyTable instead of staying at OpenKeyTable, which sounds reasonable to me.

kaijchen avatar Oct 08 '22 06:10 kaijchen

Hi, all! I have done the refactor of this PR. Could you take a look ~

Xushaohong avatar Oct 18 '22 11:10 Xushaohong

Thanks @Xushaohong for updating the patch. Filtering uncommitted blocks in verifyAndGetKeyLocations is a good idea. For clearity, it's better to return a Pair<updatedBlockLocations, uncommittedBlocks> instead, or create a inner class.

kaijchen avatar Oct 20 '22 12:10 kaijchen

@kaijchen @errose28 Thx for the review! :)

Xushaohong avatar Oct 26 '22 01:10 Xushaohong