linkedin / ambry

Distributed object store
https://github.com/linkedin/ambry/wiki
Apache License 2.0
1.75k stars 275 forks source link

Check crc for last index segment file before parsing its content #2749

Closed justinlin-linkedin closed 7 months ago

justinlin-linkedin commented 7 months ago

Summary

Checking CRC of the unsealed index segment file before parsing its content to get all the index entries. Checking the CRC before parsing would expose file corruption error. If CRC matches with the content of the file, then all the errors in the parsing, will be treated as logical error.

Test

Unit test

codecov-commenter commented 7 months ago

Codecov Report

Attention: Patch coverage is 80.64516% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 70.67%. Comparing base (2ec5676) to head (467154a).

Files Patch % Lines
...main/java/com/github/ambry/store/IndexSegment.java 80.64% 4 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2749 +/- ## ========================================= Coverage 70.66% 70.67% - Complexity 11593 11599 +6 ========================================= Files 834 834 Lines 71049 71058 +9 Branches 8536 8538 +2 ========================================= + Hits 50209 50222 +13 - Misses 18208 18213 +5 + Partials 2632 2623 -9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.