mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fixup! address comments
Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
parent
304e260038
commit
9ad36eecab
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015 The etcd Authors
|
// Copyright 2022 The etcd Authors
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
@ -105,5 +105,6 @@ func newNodeTestHarness(ctx context.Context, t *testing.T, cfg *Config, peers ..
|
|||||||
defer n.Stop()
|
defer n.Stop()
|
||||||
n.run()
|
n.run()
|
||||||
}()
|
}()
|
||||||
|
t.Cleanup(n.Stop)
|
||||||
return ctx, cancel, &nodeTestHarness{node: n, t: t}
|
return ctx, cancel, &nodeTestHarness{node: n, t: t}
|
||||||
}
|
}
|
||||||
|
@ -647,7 +647,7 @@ func (r *raft) appendEntry(es ...pb.Entry) (accepted bool) {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// use latest "last" index after truncate/append
|
// use latest "last" index after truncate/append
|
||||||
li = r.raftLog.append(es...)
|
r.raftLog.append(es...)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1133,12 +1133,26 @@ func TestRawNodeConsumeReady(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkRawNode(b *testing.B) {
|
func BenchmarkRawNode(b *testing.B) {
|
||||||
b.Run("single-voter", func(b *testing.B) {
|
cases := []struct {
|
||||||
benchmarkRawNodeImpl(b, 1)
|
name string
|
||||||
})
|
peers []uint64
|
||||||
b.Run("two-voters", func(b *testing.B) {
|
}{
|
||||||
benchmarkRawNodeImpl(b, 1, 2)
|
{
|
||||||
|
name: "single-voter",
|
||||||
|
peers: []uint64{1},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "two-voters",
|
||||||
|
peers: []uint64{1, 2},
|
||||||
|
},
|
||||||
|
// You can easily add more cases here.
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range cases {
|
||||||
|
b.Run(tc.name, func(b *testing.B) {
|
||||||
|
benchmarkRawNodeImpl(b, tc.peers...)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func benchmarkRawNodeImpl(b *testing.B, peers ...uint64) {
|
func benchmarkRawNodeImpl(b *testing.B, peers ...uint64) {
|
||||||
|
@ -52,8 +52,7 @@ type Progress struct {
|
|||||||
// RecentActive is true if the progress is recently active. Receiving any messages
|
// RecentActive is true if the progress is recently active. Receiving any messages
|
||||||
// from the corresponding follower indicates the progress is active.
|
// from the corresponding follower indicates the progress is active.
|
||||||
// RecentActive can be reset to false after an election timeout.
|
// RecentActive can be reset to false after an election timeout.
|
||||||
//
|
// This is always true on the leader.
|
||||||
// TODO(tbg): the leader should always have this set to true.
|
|
||||||
RecentActive bool
|
RecentActive bool
|
||||||
|
|
||||||
// ProbeSent is used while this follower is in StateProbe. When ProbeSent is
|
// ProbeSent is used while this follower is in StateProbe. When ProbeSent is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user