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

feat: Implement WAL-based RaftLog storage #16776

Merged
merged 21 commits into from
Nov 10, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Nov 6, 2024

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

Summary

feat: Implement WAL-based RaftLog storage

Replace sled-based storage with a dedicated WAL implementation optimized
for Raft Log operations. The new implementation provides:

Performance improvements:

  • Non-blocking batched fdatasync
  • FILO caching for latest logs (configurable size/count)
  • ~0.5ms write latency

Compatibility:

  • Backward compatible with existing data format
  • Auto-upgrades from V003 to V004 format on startup
  • Supports rolling upgrades (no protocol changes)
  • databend-metactl supports both V003/V004 import/export

Technical details:

  • New storage format: V004
  • Optimized specifically for Raft Log operations
  • Preserves all existing functionality

Tests

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

Type of change

  • New Feature (non-breaking change which adds functionality)

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Nov 6, 2024
@drmingdrmer drmingdrmer force-pushed the 165-raft-log branch 15 times, most recently from 59ab4f8 to 24449d4 Compare November 7, 2024 10:23
Replace sled-based storage with a dedicated WAL implementation optimized
for Raft Log operations. The new implementation provides:

Performance improvements:
- Non-blocking batched fdatasync
- FILO caching for latest logs (configurable size/count)
- ~0.5ms write latency

Compatibility:
- Backward compatible with existing data format
- Auto-upgrades from V003 to V004 format on startup
- Supports rolling upgrades (no protocol changes)
- databend-metactl supports both V003/V004 import/export

Technical details:
- New storage format: V004
- Optimized specifically for Raft Log operations
- Preserves all existing functionality
Because sled db is not used by meta-service anymore.
It is only used when import old format data.
@drmingdrmer drmingdrmer marked this pull request as ready for review November 10, 2024 00:59
@drmingdrmer drmingdrmer merged commit 3d76dc6 into databendlabs:main Nov 10, 2024
77 of 78 checks passed
@drmingdrmer drmingdrmer deleted the 165-raft-log branch November 10, 2024 01:51
@drmingdrmer drmingdrmer restored the 165-raft-log branch November 10, 2024 01:51
@drmingdrmer drmingdrmer deleted the 165-raft-log branch November 10, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant