GithubHelp home page GithubHelp logo

Comments (4)

tjumcw avatar tjumcw commented on August 15, 2024

不好意思上班比较忙,晚上回去我详细看一下

from 6.824.

tjumcw avatar tjumcw commented on August 15, 2024

不好意思上周忘记了,是没问题的兄弟,你看下第525行,leader为每个server维护的nextindex是不一样的,发出的rpc请求中的log是不一样长的,对于你说的宕机server会从0开始。

from 6.824.

wtmlon avatar wtmlon commented on August 15, 2024

不好意思上周忘记了,是没问题的兄弟,你看下第525行,leader为每个server维护的nextindex是不一样的,发出的rpc请求中的log是不一样长的,对于你说的宕机server会从0开始。

但是你在337行,每个新leader出现后,会把所有nextIndex设置为最新idx,这样在下一个appendEntry就会出现贴主说的问题。
按照原论文的实现,appendEntry应该是每次单步的情形从后向前试错的,只有在找到第一个idx和term都相同的节点才会进行append操作,所以这种一开始log.size()==0的情况我觉得好像得特化处理。

from 6.824.

tjumcw avatar tjumcw commented on August 15, 2024

是这样的,后续论文里我记得给出了优化的方案,是快速回滚的一种方法,MIT的资料里应该也有这部分。所以我是按照那个逻辑来,具体的记不太清楚了,周末我再看一下

from 6.824.

Related Issues (8)

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.