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

update

parent 3d9a2a07
......@@ -66,9 +66,8 @@ func (kv *KVPaxos) kill() {
// me is the index of the current server in servers[].
//
func StartServer(servers []string, me int) *KVPaxos {
// this call is all that's needed to persuade
// Go's RPC library to marshall/unmarshall
// struct Op.
// call gob.Register on structures you want
// Go's RPC library to marshall/unmarshall.
gob.Register(Op{})
kv := new(KVPaxos)
......
......@@ -122,9 +122,6 @@ func (px *Paxos) Max() int {
// The point is to free up memory in long-running
// 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()
// arguments in order to implement Min(). These
// exchanges can be piggybacked on ordinary Paxos
......
......@@ -381,7 +381,7 @@ func TestForgetMem(t *testing.T) {
for i := 1; i <= 10; i++ {
big := make([]byte, 1000000)
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))
waitn(t, pxa, i, npaxos)
......@@ -476,11 +476,11 @@ func TestRPCCount(t *testing.T) {
}
total2 -= total1
// per agreement:
// 9 prepares
// 9 accepts
// 9 decides
expected2 := ninst2 * npaxos * (npaxos + npaxos + npaxos)
// worst case per agreement:
// Proposer 1: 3 prep, 3 acc, 3 decides.
// Proposer 2: 3 prep, 3 acc, 3 prep, 3 acc, 3 decides.
// Proposer 3: 3 prep, 3 acc, 3 prep, 3 acc, 3 prep, 3 acc, 3 decides.
expected2 := ninst2 * npaxos * 15
if total2 > expected2 {
t.Fatalf("too many RPCs for concurrent Start()s; %v instances, got %v, expected %v",
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