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: fix bug in unbounded log growth prevention mechanism #10199

Merged
merged 1 commit into from
Oct 22, 2018

Commits on Oct 22, 2018

  1. raft: fix bug in unbounded log growth prevention mechanism

    The previous code was using the proto-generated `Size()` method to
    track the size of an incoming proposal at the leader. This includes
    the Index and Term, which were mutated after the call to `Size()`
    when appending to the log. Additionally, it was not taking into
    account that an ignored configuration change would ignore the
    original proposal and append an empty entry instead.
    
    As a result, a fully committed Raft group could end up with a non-
    zero tracked uncommitted Raft log counter that would eventually hit
    the ceiling and drop all future proposals indiscriminately. It would
    also immediately imply that proposals exceeding the threshold alone
    would get refused (as the "first uncommitted proposal" gets special
    treatment and is always allowed in).
    
    Track only the size of the payload actually appended to the Raft log
    instead.
    
    For context, see:
    cockroachdb/cockroach#31618 (comment)
    tbg committed Oct 22, 2018
    Configuration menu
    Copy the full SHA
    ad49c8f View commit details
    Browse the repository at this point in the history