Giter Site home page Giter Site logo

缺少选举流程 about mypaxos HOT 5 OPEN

luohaha avatar luohaha commented on September 13, 2024
缺少选举流程

from mypaxos.

Comments (5)

luohaha avatar luohaha commented on September 13, 2024

不会乱啊,每一个instance内只能确认一个提交。不过后续可以加上选举,可以优化性能,避免活锁等情况。

from mypaxos.

txm119161336 avatar txm119161336 commented on September 13, 2024

如果说,一个客户端连接是serverA发送命令x,另一个客户端连接serverB发送命令y, 此时serverA作为proposer,是否生成的instanceId =1 的情况下,serverB也会同样生成instanceId=1,这个时候,你以哪一个为准呢?一个必然会覆盖另一个,所以必须要选择主的情况下才可以,避免这个Instance创建

from mypaxos.

luohaha avatar luohaha commented on September 13, 2024

@txm119161336 其实不会的,建议你仔细看下paxos原理和实现相关的论文。因为在每个instance内,只有一个client的提案能够成功,而另外一个client 的提案在这个instance内只能同意已经被多数派同意的提案。所以另外一个client只能将自己的提案留到下一个instance,去提交。

from mypaxos.

txm119161336 avatar txm119161336 commented on September 13, 2024

@luohaha,
非常感谢你的回复,
我看错了,有一个while的条件在外面,我开始没看到,我以为你缺少了propose的重试的部分,不过即便这样,性能也是相当低的,是二阶段的通信,你说优化过了

实现了multi-paxos中连续同一leader提交时,优化协议流程,将prepare和accept流程,优化到只有accept流程,目前还是先需要propose,而后再进行acceptor
好像情况不是这样的,还是需要经过一轮的prepare的

from mypaxos.

luohaha avatar luohaha commented on September 13, 2024

@txm119161336 对,只有在同一个proposer连续提交的时候,才能做优化,否则就会退化到两阶段。所以leader选举是需要的,不过是为了性能考虑(两阶段优化到一阶段),而不是为了正确性考虑。

from mypaxos.

Related Issues (13)

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.