Coder Social home page Coder Social logo

cs6.824's Introduction

CS6.824

分布式系统课后项目

###Lab1 主要完成Master的任务调度分配,Golang的RPC比较好用。同时使用Goroutine和Channel处理并发的情况也很方便。这里在MapReduce类型中加入idleChannel以保存空闲的Worker信息。 主要涉及mapreduce目录下得文件,common.go主要包括RPC调用的参数以及Call函数,mapreduce.go主要包括map和reduce的数据操作,mapreduce的结构定义,Master和worker之间的RPC通信,master.go文件主要包括Killworker和Runmaster函数,Runmaster主要是完成Map和Ruduce任务的调度,worker.go主要是包括worker的Register操作,Shutdown操作,Dojob操作。

###Lab2 主要任务是完成初始版本的KV存储服务,主要包括ViewService,Primary节点和Backup节点。ViewService模块主要维护Primary和Backup节点信息以及在错误情况下两者的切换。

第一部分主要是完成ViewService部分,ViewService维护一个编号的view序列,每个view序列包含view序列号以及改view中primary和backup节点的信息。每一个服务节点通过定期的发送Ping包维持在线,ViewService在接收到Ping之后,发送当前的View信息。如此可见Ping包的主要有三个作用,让ViewService知道服务节点是否存活,让服务节点获取最新的View信息,ViewService了解服务节点目前的View信息。当服务节点没有在周期内发动Ping包,那么ViewService将认为服务节点掉线。当服务节点重新启动时,将发送多个参数为0的Ping包通知ViewService。

在以下几种情况下,ViewService将进行View更新:
1)在一个Ping周期内未收到Primary和Backup的Ping包;
2)Primary和Backup节点重启;
3)目前无Backup节点且系统中存在空闲的节点。
需要注意的是,只有在当前view中的primary节点已经工作在最新的view状态下,ViewService 才能进行view的更新通知。这里有可能导致ViewService永远不能更新view,当primary节点接收到最新的view之后出现down机等情况。

cs6.824's People

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.