Unverified Commit ebd9127c authored by Jay Guo's avatar Jay Guo Committed by Artem Barger
Browse files

[FAB-13845] Increase default raft tick interval



Increase default etcdraft tick interval to 500ms, for several reasons:
- in a WAN/Cloud environment, this is more realistic
- WAL sync in CI often exceeds 1s, which causes heartbeats not being
  sent timely. Increasing election timeout can decrease the chance of
  unexpected leader failover.

This CR also increases default timeout of peer cmd, because now
it takes 5~10s to elect a leader for a newly created channel, and
`peer channel create` can only retrieve genesis block of that channel
when leader exists (Deliver API returns error if leaderless).

Note that this value is still configurable by users.

Change-Id: I94fbbc750fa096cce6ef9e2d65eb981c6202b675
Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
parent 2979b8cc
......@@ -194,7 +194,7 @@ var genesisDefaults = TopLevel{
},
EtcdRaft: &etcdraft.Metadata{
Options: &etcdraft.Options{
TickInterval: 100,
TickInterval: 500,
ElectionTick: 10,
HeartbeatTick: 1,
MaxInflightMsgs: 256,
......
......@@ -90,7 +90,7 @@ Orderer: &OrdererDefaults
ClientTLSCert: path/to/ClientTLSCert2
ServerTLSCert: path/to/ServerTLSCert2
Options:
TickInterval: 100
TickInterval: 500
ElectionTick: 10
HeartbeatTick: 1
MaxInflightMsgs: 256
......
......@@ -144,7 +144,7 @@ var _ = Describe("Consenter", func() {
{ServerTlsCert: certBytes},
},
Options: &etcdraftproto.Options{
TickInterval: 100,
TickInterval: 500,
ElectionTick: 10,
HeartbeatTick: 1,
MaxInflightMsgs: 256,
......@@ -171,7 +171,7 @@ var _ = Describe("Consenter", func() {
{ServerTlsCert: []byte("cert.orderer1.org1")},
},
Options: &etcdraftproto.Options{
TickInterval: 100,
TickInterval: 500,
ElectionTick: 10,
HeartbeatTick: 1,
MaxInflightMsgs: 256,
......
......@@ -76,7 +76,7 @@ func resetFlags() {
flags.StringVarP(&channelID, "channelID", "c", common.UndefinedParamValue, "In case of a newChain command, the channel ID to create. It must be all lower case, less than 250 characters long and match the regular expression: [a-z][a-z0-9.-]*")
flags.StringVarP(&channelTxFile, "file", "f", "", "Configuration transaction file generated by a tool such as configtxgen for submitting to orderer")
flags.StringVarP(&outputBlock, "outputBlock", "", common.UndefinedParamValue, `The path to write the genesis block for the channel. (default ./<channelID>.block)`)
flags.DurationVarP(&timeout, "timeout", "t", 5*time.Second, "Channel creation timeout")
flags.DurationVarP(&timeout, "timeout", "t", 10*time.Second, "Channel creation timeout")
}
func attachFlags(cmd *cobra.Command, names []string) {
......
......@@ -315,7 +315,7 @@ Orderer: &OrdererDefaults
# TickInterval is the time interval between two Node.Tick
# invocations.
# Unit: millisecond
TickInterval: 100
TickInterval: 500
# ElectionTick is the number of Node.Tick invocations that must pass
# between elections. That is, if a follower does not receive any
......
Supports Markdown
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