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

kv: remove lastToReplica and lastFromReplica from raftMu #95861

Merged

Commits on Jan 26, 2023

  1. kv: remove lastToReplica and lastFromReplica from raftMu

    In 410ef29, we moved these fields from under the Replica.mu to under the
    Replica.raftMu. This was done to avoid lock contention.
    
    In this commit, we move these fields under their own mutex so that they
    can be accessed without holding the raftMu. This allows us to send Raft
    messages from other goroutines.
    
    The commit also switches from calling RawNode.ReportUnreachable directly
    in sendRaftMessage to using the more flexible unreachablesMu set, which
    defers the call to ReportUnreachable until the next Raft tick. As a result,
    the commit closes cockroachdb#84246.
    
    Release note: None
    Epic: None
    nvanbenschoten committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    1fff781 View commit details
    Browse the repository at this point in the history