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

Better exclusive control in log #428

Open
akiradeveloper opened this issue Oct 19, 2024 · 1 comment
Open

Better exclusive control in log #428

akiradeveloper opened this issue Oct 19, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@akiradeveloper
Copy link
Owner

akiradeveloper commented Oct 19, 2024

This is just an idea. No plan at the moment.

スクリーンショット 2024-10-20 10 23 34

The Raft log is logically separated into 4 regions and most of the case, a thread manipulates only one of them.

To gain the maximum concurrency in IO to the log, the implementation at the moment loses some sort of guarantees coming from Rust type system so we can barely be confident about the correctness. The implementation do consider the log property above however it is too implicit and hard to feel sure for readers.

The goal of this issue is design and implement nice types that still maintains the maximum concurrency but makes it more convincing.

@akiradeveloper akiradeveloper added enhancement New feature or request help wanted Extra attention is needed labels Oct 19, 2024
@akiradeveloper akiradeveloper changed the title Better locking in log Better exclusive control in log Oct 19, 2024
@akiradeveloper
Copy link
Owner Author

スクリーンショット 2024-10-20 10 25 09

Simple solution is divide the log into only two segments and protect each segment with RwLock.

This separation will make the code super convincing but sacrificing the performance because entry insertion and entry application won't happen simultaneously. I can't seriously take this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant