美文网首页
MIT6.824 Lab2B TestBackup2B 分析

MIT6.824 Lab2B TestBackup2B 分析

作者: 东京的雨不会淋湿首尔 | 来源:发表于2020-08-30 17:00 被阅读0次

TestBackup2B 分析:

1.

0 1 2 3 4

All add a log and commit l1 leader 0
0: <l1,1>
1: <l1,1>
2: <l1,1>
3: <l1,1>
4: <l1,1>

2.

2,3,4 offline
0,1 add a log but not commit

0 1

0: <l1,1>, <l2,1>
1: <l1,1>, <l2,1>
2: <l1,1>
3: <l1,1>
4: <l1,1>

3.

0,1 offline
2,3,4 reconnect ,maybe leader 2 and leader's term change ,add a log l3 and commit. leader 2

2 3 4

0: <l1,1>, <l2,1>
1: <l1,1>, <l2,1>
2: <l1,1>, <l3,2>
3: <l1,1>, <l3,2>
4: <l1,1>, <l3,2>

4.

Disconnect a follower from 2,3,4, eg: 3
Then add a log l4

2 4

0: <l1,1>, <l2,1>
1: <l1,1>, <l2,1>
2: <l1,1>, <l3,2>, <l4,2>
3: <l1,1>, <l3,2>
4: <l1,1>, <l3,2>, <l4,2>

5.

All disconnect ,and reconnect 0, 1 and a follower from step 4( server 3) ,
So now server 3 should be the leader ( has last log ),then term change .maybe 3
Server convert to candidate
Then add a log l5 (server 0 was leader from step 1)

0 1 3

0: <l1,1>, <l2,1>
1: <l1,1>, <l2,1>
2: <l1,1>, <l3,2>, <l4,2>
3: <l1,1>, <l3,2>, <l5,3>
4: <l1,1>, <l3,2>, <l4,2>

Sync to server 0 and server 1
0: <l1,1>, <l3,2>, <l5,3>
1: <l1,1>, <l3,2>, <l5,3>
2: <l1,1>, <l3,2>, <l4,2>
3: <l1,1>, <l3,2>, <l5,3>
4: <l1,1>, <l3,2>, <l4,2>

6.

Then all start and add a log l6
Server should be the leader

0 1 2 3 4

0: <l1,1>, <l3,2>, <l5,3>
1: <l1,1>, <l3,2>, <l5,3>
2: <l1,1>, <l3,2>, <l4,2>
3: <l1,1>, <l3,2>, <l5,3> ,<l6,3>
4: <l1,1>, <l3,2>, <l4,2>
Then sync log to others

相关文章

  • MIT6.824 Lab2B TestBackup2B 分析

    TestBackup2B 分析: 1. 01234 All add a log and commit l1 le...

  • pwn笔记之Modern Binary Exploitation

    附:gcc -O0 -fno-stack-protector lab2B.c -o lab2B 编译的时候开启栈保...

  • MIT6.824(一)

    分布式系统的驱动力和挑战 人们使用大量的相互协作的计算机驱动力是: 人们需要获得更高的计算性能。可以这么理解这一点...

  • 分布式系统学习1-mapreduce实现

    MIT6.824 2017课程作业的lab1,使用go语言实现mapreduce。框架代码来自 git://g.c...

  • The Go Memory Model翻译及理解

    前言 最近看mit6.824,里面第五节课有推荐看The Go Memory Model这篇文章 网上翻译也有一些...

  • MIT6.824 Lab1

    Lab 1. 完成Map和Reduce函数 lab1我一开始以为很难,实际做下来发现难度尚可,只要一点点做就没有问...

  • MIT6.824 Lab1 MapReduce

    lab1是在单机上实现mapreduce库,因为没有分布式环境,所以只能实现序列化操作和用并行操作代替分布式操作。...

  • MIT6.824 Lab1 MapReduce

    Introduction 在本实验中,将用Go编程构建一个MapReduce库。在第一部分中,将编写一个简单的Ma...

  • raft理论与实践[4]-lab2b

    准备工作 阅读raft论文 阅读我写的raft理论与实践[1]-理论篇 阅读raft理论与实践[2]-lab2a ...

  • 分布式系统一致性问题与Raft算法(上)

    最近在做MIT6.824的几个实验,真心觉得每一个做分布式相关开发的程序员都应该去刷一遍(裂墙推荐),肯定能够提高...

网友评论

      本文标题:MIT6.824 Lab2B TestBackup2B 分析

      本文链接:https://www.haomeiwen.com/subject/ufyesktx.html