Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[log] Fix the crc checksum error cause by The MemoryLogRecordsArrowBuilder#getSizeInBytes() maybe modify the memory data after closed #153

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

swuferhong
Copy link
Collaborator

Purpose

Linked issue: #152

Currently, if we use the default log format ARROW to write log, the crc checksum error in server will be thrown. After debug, I find the error is caused by the MemoryLogRecordsArrowBuilder#getSizeInBytes() method, it may cause CRC check error due to memory modifications after the builder is closed.

Tests

Add UT in MemoryLogRecordsArrowBuilderTest to verify.

API and Format

Documentation

No docs.

@swuferhong swuferhong force-pushed the crc-exception branch 2 times, most recently from 83b30b4 to a71d8fa Compare December 10, 2024 07:34
@swuferhong
Copy link
Collaborator Author

@wuchong @luoyuxia @loserwang1024 CI is passed, could you take a look at this pr.

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

This will make the getSizeInBytes() inconsistent if getSizeInBytes() is called before close(). A clean solution:

Add a member variable boolean reCalculateSizeInBytes = false, and set it to true for append. And re-calculate the sizeInBytes in getSizeInBytes() if reCalculateSizeInBytes is true, and set it back to false in the end of getSizeInBytes().

@swuferhong
Copy link
Collaborator Author

This will make the getSizeInBytes() inconsistent if getSizeInBytes() is called before close(). A clean solution:

Add a member variable boolean reCalculateSizeInBytes = false, and set it to true for append. And re-calculate the sizeInBytes in getSizeInBytes() if reCalculateSizeInBytes is true, and set it back to false in the end of getSizeInBytes().

comments addressed

@swuferhong
Copy link
Collaborator Author

@wuchong comments addressed.

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

LGTM.

@wuchong wuchong merged commit f0d800b into alibaba:main Dec 16, 2024
2 checks passed
polyzos pushed a commit to polyzos/fluss that referenced this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants