# mit6.5840 **Repository Path**: li-czhou/mit6.5840 ## Basic Information - **Project Name**: mit6.5840 - **Description**: 用来记录mit6.5840(原6.824)的实现历程 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-02 - **Last Updated**: 2026-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README lab1 lcz@iv-yef3xahqtc5i3z5jzmr5:~/mit6.5840/6.5840/src$ make mr go build -race -o main/mrsequential main/mrsequential.go go build -race -o main/mrcoordinator main/mrcoordinator.go go build -race -o main/mrworker main/mrworker.go& (cd mrapps && go build -race -buildmode=plugin wc.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin indexer.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin mtiming.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin rtiming.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin jobcount.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin early_exit.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin crash.go) || exit 1 (cd mrapps && go build -race -buildmode=plugin nocrash.go) || exit 1 cd mr; go test -v -race === RUN TestWc --- PASS: TestWc (10.58s) === RUN TestIndexer --- PASS: TestIndexer (6.78s) === RUN TestMapParallel --- PASS: TestMapParallel (8.02s) === RUN TestReduceParallel --- PASS: TestReduceParallel (9.03s) === RUN TestJobCount --- PASS: TestJobCount (12.03s) === RUN TestEarlyExit --- PASS: TestEarlyExit (7.03s) === RUN TestCrashWorker 2026/03/02 21:01:29 检测到 Map 任务 0 超时,重置为 Idle 2026/03/02 21:01:29 检测到 Map 任务 1 超时,重置为 Idle 2026/03/02 21:01:29 检测到 Map 任务 4 超时,重置为 Idle 2026/03/02 21:02:01 检测到 Reduce 任务 0 超时,重置为 Idle 2026/03/02 21:02:01 检测到 Reduce 任务 2 超时,重置为 Idle 2026/03/02 21:02:01 检测到 Reduce 任务 5 超时,重置为 Idle 2026/03/02 21:02:01 检测到 Reduce 任务 9 超时,重置为 Idle 2026/03/02 21:02:31 检测到 Reduce 任务 9 超时,重置为 Idle --- PASS: TestCrashWorker (97.14s) PASS ok 6.5840/mr 151.614s - lcz@iv-yef3xahqtc5i3z5jzmr5:~/6.5840/src$ make kvsrv1 - go build -race -o main/kvsrv1d main/kvsrv1d.go - cd kvsrv1 && go test -v -race - === RUN TestReliablePut - One client and reliable Put (reliable network)... - ... Passed -- time 0.0s #peers 1 #RPCs 5 #Ops 5 - --- PASS: TestReliablePut (0.12s) - === RUN TestPutConcurrentReliable - Test: many clients racing to put values to the same key (reliable network)... - ... Passed -- time 1.6s #peers 1 #RPCs 2393 #Ops 4786 - --- PASS: TestPutConcurrentReliable (1.85s) - === RUN TestMemPutManyClientsReliable - Test: memory use many put clients (reliable network)... - ... Passed -- time 28.2s #peers 1 #RPCs 20000 #Ops 20000 - --- PASS: TestMemPutManyClientsReliable (53.10s) - === RUN TestUnreliableNet - One client (unreliable network)... - ... Passed -- time 4.0s #peers 1 #RPCs 248 #Ops 416 - --- PASS: TestUnreliableNet (4.12s) - PASS - ok 6.5840/kvsrv1 60.218s - lcz@iv-yef3xahqtc5i3z5jzmr5:~/6.5840/src$ make lock1 - go build -race -o main/kvsrv1d main/kvsrv1d.go - cd kvsrv1/lock; go test -v -race - === RUN TestReliableBasic - Test: a single Acquire and Release (reliable network)... - ... Passed -- time 0.0s #peers 1 #RPCs 4 #Ops 4 - --- PASS: TestReliableBasic (0.12s) - === RUN TestReliableNested - Test: one client, two locks (reliable network)... - ... Passed -- time 0.0s #peers 1 #RPCs 20 #Ops 20 - --- PASS: TestReliableNested (0.14s) - === RUN TestOneClientReliable - Test: 1 lock clients (reliable network)... - ... Passed -- time 2.0s #peers 1 #RPCs 716 #Ops 716 - --- PASS: TestOneClientReliable (2.12s) - === RUN TestManyClientsReliable - Test: 10 lock clients (reliable network)... - ... Passed -- time 2.2s #peers 1 #RPCs 3375 #Ops 3375 - --- PASS: TestManyClientsReliable (2.34s) - === RUN TestOneClientUnreliable - Test: 1 lock clients (unreliable network)... - ... Passed -- time 2.1s #peers 1 #RPCs 133 #Ops 104 - --- PASS: TestOneClientUnreliable (2.21s) - === RUN TestManyClientsUnreliable - Test: 10 lock clients (unreliable network)... - ... Passed -- time 3.1s #peers 1 #RPCs 1425 #Ops 1133 - --- PASS: TestManyClientsUnreliable (3.24s) - PASS - ok 6.5840/kvsrv1/lock 11.178s lcz@iv-yef3xahqtc5i3z5jzmr5:~/mit6.5840/6.5840/src$ make RUN="-run 3A" raft1 go build -race -o main/raft1d main/raft1d.go cd raft1 && go test -v -race -run 3A === RUN TestInitialElection3A Test (3A): initial election (reliable network)... ... Passed -- time 3.0s #peers 3 #RPCs 192 #Ops 0 --- PASS: TestInitialElection3A (3.47s) === RUN TestReElection3A Test (3A): election after network failure (reliable network)... ... Passed -- time 4.6s #peers 3 #RPCs 390 #Ops 0 --- PASS: TestReElection3A (5.12s) === RUN TestManyElections3A Test (3A): multiple elections (reliable network)... ... Passed -- time 5.6s #peers 7 #RPCs 1680 #Ops 0 --- PASS: TestManyElections3A (6.59s) PASS ok 6.5840/raft1 16.203s lcz@iv-yef3xahqtc5i3z5jzmr5:~/mit6.5840/6.5840/src$ make RUN="-run 3B" raft1 go build -race -o main/raft1d main/raft1d.go cd raft1 && go test -v -race -run 3B === RUN TestBasicAgree3B Test (3B): basic agreement (reliable network)... ... Passed -- time 0.4s #peers 3 #RPCs 14 #Ops 3 --- PASS: TestBasicAgree3B (0.71s) === RUN TestRPCBytes3B Test (3B): RPC byte count (reliable network)... ... Passed -- time 1.8s #peers 3 #RPCs 58 #Ops 11 --- PASS: TestRPCBytes3B (2.14s) === RUN TestFollowerFailure3B Test (3B): test progressive failure of followers (reliable network)... ... Passed -- time 4.3s #peers 3 #RPCs 188 #Ops 3 --- PASS: TestFollowerFailure3B (4.67s) === RUN TestLeaderFailure3B Test (3B): test failure of leaders (reliable network)... ... Passed -- time 4.7s #peers 3 #RPCs 294 #Ops 3 --- PASS: TestLeaderFailure3B (5.03s) === RUN TestFailAgree3B Test (3B): agreement after follower reconnects (reliable network)... ... Passed -- time 3.9s #peers 3 #RPCs 134 #Ops 7 --- PASS: TestFailAgree3B (4.37s) === RUN TestFailNoAgree3B Test (3B): no agreement if too many followers disconnect (reliable network)... ... Passed -- time 3.3s #peers 5 #RPCs 316 #Ops 2 --- PASS: TestFailNoAgree3B (3.81s) === RUN TestConcurrentStarts3B Test (3B): concurrent Start()s (reliable network)... ... Passed -- time 0.6s #peers 3 #RPCs 24 #Ops 0 --- PASS: TestConcurrentStarts3B (1.07s) === RUN TestRejoin3B Test (3B): rejoin of partitioned leader (reliable network)... ... Passed -- time 5.7s #peers 3 #RPCs 282 #Ops 4 --- PASS: TestRejoin3B (6.05s) === RUN TestBackup3B Test (3B): leader backs up quickly over incorrect follower logs (reliable network)... ... Passed -- time 19.1s #peers 5 #RPCs 2568 #Ops 102 --- PASS: TestBackup3B (19.68s) === RUN TestCount3B Test (3B): RPC counts aren't too high (reliable network)... ... Passed -- time 2.2s #peers 3 #RPCs 72 #Ops 0 --- PASS: TestCount3B (2.71s) PASS ok 6.5840/raft1 51.273s lcz@iv-yef3xahqtc5i3z5jzmr5:~/mit6.5840/6.5840/src$ make RUN="-run 3C" raft1 go build -race -o main/raft1d main/raft1d.go cd raft1 && go test -v -race -run 3C === RUN TestPersist13C Test (3C): basic persistence (reliable network)... ... Passed -- time 3.3s #peers 3 #RPCs 98 #Ops 6 --- PASS: TestPersist13C (3.75s) === RUN TestPersist23C Test (3C): more persistence (reliable network)... ... Passed -- time 13.7s #peers 5 #RPCs 568 #Ops 16 --- PASS: TestPersist23C (14.36s) === RUN TestPersist33C Test (3C): partitioned leader and one follower crash, leader restarts (reliable network)... ... Passed -- time 1.5s #peers 3 #RPCs 48 #Ops 4 --- PASS: TestPersist33C (1.84s) === RUN TestFigure83C Test (3C): Figure 8 (reliable network)... 2026/03/18 22:15:05 6PCdkEFTs2eiMT_RlFB1: dmxsrv.reader: clnt ACu3swj2_8gbs1Wd6nbn ReadCall err read unix /tmp/6.5840-6PCdkEFTs2eiMT_RlFB1->@: read: connection reset by peer 2026/03/18 22:15:47 6PCdkEFTs2eiMT_RlFB1: dmxsrv.reader: clnt 5VPxjteaE_i4P1o9h71T ReadCall err read unix /tmp/6.5840-6PCdkEFTs2eiMT_RlFB1->@: read: connection reset by peer ... Passed -- time 51.8s #peers 5 #RPCs 2369 #Ops 2 --- PASS: TestFigure83C (52.30s) === RUN TestUnreliableAgree3C Test (3C): unreliable agreement (unreliable network)... ... Passed -- time 3.4s #peers 5 #RPCs 220 #Ops 246 --- PASS: TestUnreliableAgree3C (4.02s) === RUN TestFigure8Unreliable3C Test (3C): Figure 8 (unreliable) (unreliable network)... ... Passed -- time 48.0s #peers 5 #RPCs 7496 #Ops 2 2026/03/18 22:16:44 T5AgHTtizWPRzjsYwAQ6: dmxsrv.reader: clnt UkD_e2Q-b5OG3f1PBPSa ReadCall err read unix /tmp/6.5840-T5AgHTtizWPRzjsYwAQ6->@: read: connection reset by peer --- PASS: TestFigure8Unreliable3C (48.77s) === RUN TestReliableChurn3C Test (3C): churn (reliable network)... ... Passed -- time 16.6s #peers 5 #RPCs 1084 #Ops 1 --- PASS: TestReliableChurn3C (17.17s) === RUN TestUnreliableChurn3C Test (3C): unreliable churn (unreliable network)... ... Passed -- time 16.8s #peers 5 #RPCs 1028 #Ops 1 --- PASS: TestUnreliableChurn3C (17.46s) PASS ok 6.5840/raft1 160.685s