Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Doug Woos
452-labs
Commits
674de09e
Commit
674de09e
authored
Feb 20, 2014
by
Yandong Mao
Browse files
update
parent
3d9a2a07
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/kvpaxos/server.go
View file @
674de09e
...
...
@@ -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
)
...
...
src/paxos/paxos.go
View file @
674de09e
...
...
@@ -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
...
...
src/paxos/test_test.go
View file @
674de09e
...
...
@@ -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 prepar
es
//
9 accepts
//
9
decides
expected2
:=
ninst2
*
npaxos
*
(
npaxos
+
npaxos
+
npaxos
)
//
worst case
per agreement:
//
Proposer 1: 3 prep, 3 acc, 3 decid
es
.
//
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment