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

[WIP] Prevent unbounded Raft log growth. #139

Closed
wants to merge 3 commits into from

Conversation

utsl42
Copy link

@utsl42 utsl42 commented Nov 8, 2018

Issue #131

src/raft.rs Show resolved Hide resolved
src/raft.rs Show resolved Hide resolved
/// determines whether they would push leader over its max_uncommitted_entries_size limit.
/// If the new entries would exceed the limit, the method returns false. If not,
/// the increase in uncommitted entry size is recorded and the method returns
/// true.
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a # Panics section which details that passing 0 as max will cause a panic.

Copy link
Author

Choose a reason for hiding this comment

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

I only added the panic to help me chase down an annoying bug where I broke all the tests. Can just pull it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. :)

@@ -252,6 +261,13 @@ impl<T: Storage> RaftLog<T> {
self.last_index()
)
}
let entries = self
.slice(
Copy link
Author

Choose a reason for hiding this comment

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

Could this use unstable_entries instead of slice? If so, the unwrap would become unnecessary here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I worry in this situation that there would be entries written to stable storage, but not yet committed.

You can see here: https://docs.rs/raft/0.4.0/raft/raw_node/struct.Ready.html#structfield.committed_entries

CommittedEntries specifies entries to be committed to a store/state-machine. These have previously been committed to stable store.

Meanwhile: https://docs.rs/raft/0.4.0/raft/raw_node/struct.Ready.html#structfield.entries

Entries specifies entries to be saved to stable storage BEFORE Messages are sent.

So if we only rely on unstable_entries I think it means we might not see all the uncommitted entries.

@Hoverbear
Copy link
Contributor

Hi @utsl42! Are you still working on this?

@utsl42
Copy link
Author

utsl42 commented Nov 30, 2018 via email

@Hoverbear
Copy link
Contributor

Hi @utsl42, still thinking of picking this back up?

@Hoverbear Hoverbear added this to the 0.6.0 milestone Feb 11, 2019
@Hoverbear Hoverbear added the Help Wanted An issue with unsolved problems, looking for help. label Feb 11, 2019
@ghost
Copy link

ghost commented Apr 7, 2019

@Hoverbear @utsl42 do you want to finish it by youself or can i try to help you?

@Hoverbear
Copy link
Contributor

@652h If you wanted to open up a revival PR I'd be very happy to help shepherd it to merge! I was hoping to revisit this soon but haven't have a moment.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Hoverbear
❌ utsl42
You have signed the CLA already but the status is still pending? Let us recheck it.

@BusyJay
Copy link
Member

BusyJay commented Jun 7, 2021

This was implemented as #398, close it now, thanks!

@BusyJay BusyJay closed this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted An issue with unsolved problems, looking for help.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants