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

raft: refactor inflight #4931

Closed
wants to merge 1 commit into from
Closed

raft: refactor inflight #4931

wants to merge 1 commit into from

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Apr 1, 2016

@@ -64,12 +64,17 @@ type Progress struct {
RecentActive bool

// inflights is a sliding window for the inflight messages.
// Each inflight message might contain more than one entries
// and has a size limit defined in raft config as MaxSizePerMsg.
Copy link

Choose a reason for hiding this comment

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

A size limit in number of bytes or number of entries? I'm again confused about the purpose of this whole thing. Are the number of bytes tracked anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry... So a message contains one or multiple raft entries. Each message has a max size.

Say leader sends 8 entries with 1MB per entries. For each message, the max size is 4MB. With flow control, two messages with entries [1,2,3,4] and [5,6,7,8] will be sent. We will have [4, 8] in inflights.

Once follower replies with index 8, then we clear 4 and 8 from inflights together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am considering to just make this a direct bytes based control. But it requires some changes from the upper level rafthttp, which now has a message based buffer (N number of messages).

@ongardie
Copy link

@philips, I mentioned this one last night, I think you wanted to take a look

@gyuho
Copy link
Contributor

gyuho commented Jun 24, 2016

@xiang90 Shall we merge this? Low risk. lgtm.

@@ -183,14 +188,13 @@ type inflights struct {
// number of inflights in the buffer
count int

// the size of the buffer
size int
// buffer contains the index of the last entry
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to word

// buffer contains the last entry indexes of each message.

@gyuho
Copy link
Contributor

gyuho commented Sep 7, 2016

@xiang90 I think this is now conflict with #6353.

I can cherry-pick the comment part if you want.

@gyuho gyuho mentioned this pull request Sep 23, 2016
@gyuho gyuho closed this Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants