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

fix: handle trailing zeros in Raft log WAL with EXT4 writeback mode #17042

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Dec 12, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

fix: handle trailing zeros in Raft log WAL with EXT4 writeback mode

When EXT4 is mounted with data=writeback, data and metadata (file length)
can be written to disk in arbitrary order, potentially leaving trailing
zeros in the WAL tail.

Fix: Truncate zero bytes starting from the first un-decodable WALRecord
and treat the chunk as successfully opened.

This issue is fixed in the dependent crate:

chore: refine logging

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Dec 12, 2024
@drmingdrmer drmingdrmer marked this pull request as ready for review December 12, 2024 05:48
When EXT4 is mounted with data=writeback, data and metadata (file length)
can be written to disk in arbitrary order, potentially leaving trailing
zeros in the WAL tail.

Fix: Truncate zero bytes starting from the first un-decodable WALRecord
and treat the chunk as successfully opened.

This issue is fixed in the dependent crate:
- drmingdrmer/raft-log@757542b
@drmingdrmer drmingdrmer merged commit 5a1546e into databendlabs:main Dec 12, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant