Skip to content

maxUncommittedLogSize not enforced across term changes #11

Description

@tbg

See etcd-io/etcd#14627 (comment).

In becomeLeader, we call r.reset() which resets the uncommitted log size. This means that in theory the uncommitted log size isn't bounded:

  • 5x replication
  • peer 1 becomes leader (committed = 1)
  • peer 1 amasses uncommitted log up to the limit, only replicates it to peer 2 but not 3-5 (so no quorum)
  • peer 1 loses leadership
  • peer 2 becomes leader (committed = 1)
  • peer 2 amasses more log entries
  • peer 1 becomes leader
  • ...

We could either

  • live with that, but uncommitted log is amassed precisely in situations where leadership is unstable, so the counter-example could happen in practice (esp. under a workload that proposes large log entries)
  • not reset the uncommitted log size across term changes
  • scan the uncommitted log when becoming leader to obtain its size (can be expensive and has potential to further destabilize the system).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions