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 Rocksdb log storage #124

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

TaskerJang
Copy link
Contributor

This code introduces the implementation of a Raft storage engine using RocksDB for persisting logs, snapshots, and state. The RocksDBStorage struct is designed to handle Raft logs, making it suitable for distributed systems requiring consensus. Key functionalities include:

  • Log Storage: The append method is responsible for storing Raft entries (logs) in RocksDB, with the Raft log index used as the key.
  • State Management: hard_state and conf_state methods are provided for retrieving and persisting the hard state and configuration state of Raft nodes.
  • Snapshot Management: The create_snapshot and apply_snapshot methods handle the creation and application of Raft snapshots, ensuring that the state is persisted in the event of failures or leader changes.
  • Compaction: The compact method provides log compaction functionality, removing older log entries no longer needed by the Raft consensus algorithm.
  • Entry Retrieval: Methods such as entries, first_index, and last_index allow efficient retrieval of log entries, terms, and indices.
  • Testing: A comprehensive set of unit tests is included to validate the functionality of the storage system, including tests for log append, snapshot application, and index retrieval.

Features

  • Persistence: Using RocksDB for durable storage of Raft logs, snapshots, and state.
  • Compaction: Efficient log compaction to manage storage size.
  • Snapshot Management: Full support for creating and applying Raft snapshots.
  • Error Handling: Graceful error handling for missing data or unavailable storage.
  • Test Coverage: Extensive tests covering core functionalities such as log appending, snapshot handling, and storage compaction.

Copy link

cla-assistant bot commented Sep 15, 2024

CLA assistant check
All committers have signed the CLA.

@jopemachine jopemachine changed the title Feature/tasker jang/93 feat: Implement RocksDB log storage Sep 15, 2024
@jopemachine jopemachine linked an issue Sep 15, 2024 that may be closed by this pull request
@jopemachine jopemachine added log-storage Log store (Stable storage) feature New feature or request labels Sep 15, 2024
@jopemachine jopemachine changed the title feat: Implement RocksDB log storage feat: Implement Rocksdb log storage Sep 15, 2024
@jopemachine jopemachine marked this pull request as draft September 29, 2024 03:41
@jopemachine jopemachine force-pushed the feature/TaskerJang/93 branch 3 times, most recently from 6f5f488 to 35216ae Compare September 30, 2024 10:06
@jopemachine jopemachine marked this pull request as ready for review September 30, 2024 10:11
@jopemachine
Copy link
Member

Thanks!

@jopemachine jopemachine merged commit eebd752 into lablup:main Sep 30, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request log-storage Log store (Stable storage)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Rocksdb storage
2 participants