Coder Social home page Coder Social logo

如果是主动关掉leader节点,由leader通知其他follower 进入选举状态,能不能减少不可用时间? about raft-zh_cn HOT 3 OPEN

maemual avatar maemual commented on August 18, 2024
如果是主动关掉leader节点,由leader通知其他follower 进入选举状态,能不能减少不可用时间?

from raft-zh_cn.

Comments (3)

Codebells avatar Codebells commented on August 18, 2024

应该是有问题的,以下
leader通知其他follower 进入选举状态,哪个成为Candidate?如果收到Leader发出的通知就成为Candidate,那么不可避免会在同一个选举阶段存在很多Candidate,导致第一轮选举失败(因为Candidate首先会给自己投票,就不会投票给其他Candidate),进行第二轮选举,所以既然大概率第一轮选举无效,那干脆不通知其他Follower进入选举而等Follower超时投票可能反而更快

from raft-zh_cn.

supergaga avatar supergaga commented on August 18, 2024

应该是有问题的,以下 leader通知其他follower 进入选举状态,哪个成为Candidate?如果收到Leader发出的通知就成为Candidate,那么不可避免会在同一个选举阶段存在很多Candidate,导致第一轮选举失败(因为Candidate首先会给自己投票,就不会投票给其他Candidate),进行第二轮选举,所以既然大概率第一轮选举无效,那干脆不通知其他Follower进入选举而等Follower超时投票可能反而更快

随机时间超时后进入Candidate,倾向性指定的节点适当减少超时时间, 确保第一轮先进入Candidate,由于日志进度问题 第一轮不一定当选 ,后续选举的时候,所有节点随机时间没有倾向性 ,正常去选举

from raft-zh_cn.

Codebells avatar Codebells commented on August 18, 2024

应该是有问题的,以下 leader通知其他follower 进入选举状态,哪个成为Candidate?如果收到Leader发出的通知就成为Candidate,那么不可避免会在同一个选举阶段存在很多Candidate,导致第一轮选举失败(因为Candidate首先会给自己投票,就不会投票给其他Candidate),进行第二轮选举,所以既然大概率第一轮选举无效,那干脆不通知其他Follower进入选举而等Follower超时投票可能反而更快

随机时间超时后进入Candidate,倾向性指定的节点适当减少超时时间, 确保第一轮先进入Candidate,由于日志进度问题 第一轮不一定当选 ,后续选举的时候,所有节点随机时间没有倾向性 ,正常去选举

这个倾向性指定节点的选择依据什么规则?感觉这个指定节点的规则挺难确定的,个人感觉实用性不大,就算每次都成功也只能减少部分等待的时间(倾向性指定的节点适当减少超时时间)几十毫秒?

from raft-zh_cn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.