Commit 674de09e authored by Yandong Mao's avatar Yandong Mao

update

parent 3d9a2a07
...@@ -66,9 +66,8 @@ func (kv *KVPaxos) kill() { ...@@ -66,9 +66,8 @@ func (kv *KVPaxos) kill() {
// me is the index of the current server in servers[]. // me is the index of the current server in servers[].
// //
func StartServer(servers []string, me int) *KVPaxos { func StartServer(servers []string, me int) *KVPaxos {
// this call is all that's needed to persuade // call gob.Register on structures you want
// Go's RPC library to marshall/unmarshall // Go's RPC library to marshall/unmarshall.
// struct Op.
gob.Register(Op{}) gob.Register(Op{})
kv := new(KVPaxos) kv := new(KVPaxos)
......
...@@ -122,9 +122,6 @@ func (px *Paxos) Max() int { ...@@ -122,9 +122,6 @@ func (px *Paxos) Max() int {
// The point is to free up memory in long-running // The point is to free up memory in long-running
// Paxos-based servers. // Paxos-based servers.
// //
// It is illegal to call Done(i) on a peer and
// then call Start(j) on that peer for any j <= i.
//
// Paxos peers need to exchange their highest Done() // Paxos peers need to exchange their highest Done()
// arguments in order to implement Min(). These // arguments in order to implement Min(). These
// exchanges can be piggybacked on ordinary Paxos // exchanges can be piggybacked on ordinary Paxos
......
...@@ -381,7 +381,7 @@ func TestForgetMem(t *testing.T) { ...@@ -381,7 +381,7 @@ func TestForgetMem(t *testing.T) {
for i := 1; i <= 10; i++ { for i := 1; i <= 10; i++ {
big := make([]byte, 1000000) big := make([]byte, 1000000)
for j := 0; j < len(big); j++ { for j := 0; j < len(big); j++ {
big[j] = byte(rand.Int() % 100) big[j] = byte('a' + rand.Int() % 26)
} }
pxa[0].Start(i, string(big)) pxa[0].Start(i, string(big))
waitn(t, pxa, i, npaxos) waitn(t, pxa, i, npaxos)
...@@ -476,11 +476,11 @@ func TestRPCCount(t *testing.T) { ...@@ -476,11 +476,11 @@ func TestRPCCount(t *testing.T) {
} }
total2 -= total1 total2 -= total1
// per agreement: // worst case per agreement:
// 9 prepares // Proposer 1: 3 prep, 3 acc, 3 decides.
// 9 accepts // Proposer 2: 3 prep, 3 acc, 3 prep, 3 acc, 3 decides.
// 9 decides // Proposer 3: 3 prep, 3 acc, 3 prep, 3 acc, 3 prep, 3 acc, 3 decides.
expected2 := ninst2 * npaxos * (npaxos + npaxos + npaxos) expected2 := ninst2 * npaxos * 15
if total2 > expected2 { if total2 > expected2 {
t.Fatalf("too many RPCs for concurrent Start()s; %v instances, got %v, expected %v", t.Fatalf("too many RPCs for concurrent Start()s; %v instances, got %v, expected %v",
ninst2, total2, expected2) ninst2, total2, expected2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment