Non-smooth raft leadership transition
System information
Geth version: 1.7.2-stable
OS & Version: Ubuntu 16.04
Branch, Commit Hash or Release: f651c1be
Expected behaviour
When there are pending transactions, even when the leader changes, the new leader can still mint new blocks and the rest of network follows the new leader without any user intervention.
Actual behaviour
Sometimes, block number was stuck at some height. I have to restart the leader node to make the network (elect a new leader and) mint new blocks. Or I have to wait for an uncertain period of time until a member, perhaps accidentally, miss the leader's heart beat.
Steps to reproduce the behaviour
Given a 6-node Quorum network running raft consensus, I constantly sent some tx to 5 of the nodes (below 10 tx per second per node). After some time, block number of all nodes was stuck at some height and didn't go up even i continued to send new transactions.
Backtrace
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 received MsgVoteResp rejection from 6 at term 503
raft2018/02/27 09:16:06 INFO: 3 [quorum:4] has received 3 MsgVoteResp votes and 1 vote rejections
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
raft2018/02/27 09:16:06 INFO: 3 [term: 503] ignored a MsgApp message with lower term from 6 [term: 502]
TRACE[02-27|09:16:06] Pooled new future transaction hash=ab9a9e…ff1f2b from=0xcEEa014b672b8b4711213a4af27b188d558B071F to=nil
TRACE[02-27|09:16:06] Promoting queued transaction hash=ab9a9e…ff1f2b
INFO [02-27|09:16:06] Submitted contract creation fullhash=0xab9a9edb02537b776a143372c3bfade4b40bad13cf3b88d6c6104d83d1ff1f2b to=0x7D9c082c0Ac426Cff26b449C1F050C67eA8be780
TRACE[02-27|09:16:06] Broadcast transaction hash=ab9a9e…ff1f2b recipients=5
TRACE[02-27|09:16:06] Pooled new future transaction hash=1e8c9f…4255ea from=0x6FD4387f6A5687f85d6b6a879678aF9b5e8F5aEf to=nil
TRACE[02-27|09:16:06] Promoting queued transaction hash=1e8c9f…4255ea
TRACE[02-27|09:16:06] Broadcast transaction hash=1e8c9f…4255ea recipients=3
TRACE[02-27|09:16:06] Pooled new future transaction hash=3a5729…f5072c from=0xE70aB8A54cd520f5B0C7E2533859Bc969249B510 to=nil
TRACE[02-27|09:16:06] Promoting queued transaction hash=3a5729…f5072c
TRACE[02-27|09:16:06] Discarding already known transaction hash=3a5729…f5072c
TRACE[02-27|09:16:06] Discarding already known transaction hash=1e8c9f…4255ea
TRACE[02-27|09:16:06] Broadcast transaction hash=3a5729…f5072c recipients=2
TRACE[02-27|09:16:06] Discarding already known transaction hash=1e8c9f…4255ea
TRACE[02-27|09:16:06] Discarding already known transaction hash=3a5729…f5072c
TRACE[02-27|09:16:06] Discarding already known transaction hash=3a5729…f5072c
TRACE[02-27|09:16:06] Pooled new future transaction hash=65877d…b26d72 from=0x14fC2f8771f10537A7F673255809b4adceD9b416 to=nil
TRACE[02-27|09:16:06] Promoting queued transaction hash=65877d…b26d72
TRACE[02-27|09:16:06] Discarding already known transaction hash=65877d…b26d72
TRACE[02-27|09:16:06] Discarding already known transaction hash=3a5729…f5072c
TRACE[02-27|09:16:06] Broadcast transaction hash=65877d…b26d72 recipients=3
TRACE[02-27|09:16:06] Discarding already known transaction hash=65877d…b26d72
TRACE[02-27|09:16:06] Discarding already known transaction hash=65877d…b26d72
TRACE[02-27|09:16:06] Pooled new future transaction hash=964de1…08ddd4 from=0x16b95251E0F9A0974342D45a2d3969f8dCd76165 to=nil
TRACE[02-27|09:16:06] Promoting queued transaction hash=964de1…08ddd4
TRACE[02-27|09:16:06] Discarding already known transaction hash=964de1…08ddd4
TRACE[02-27|09:16:06] Broadcast transaction hash=964de1…08ddd4 recipients=4
raft2018/02/27 09:16:07 INFO: 3 received MsgVoteResp from 4 at term 503
raft2018/02/27 09:16:07 INFO: 3 [quorum:4] has received 4 MsgVoteResp votes and 1 vote rejections
raft2018/02/27 09:16:07 INFO: 3 became leader at term 503
raft2018/02/27 09:16:07 INFO: raft.node: 3 elected leader 3 at term 503
INFO [02-27|09:16:07] TX failed, will be removed hash=23a2c9…6ec205 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=69e4c3…b64d93 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=b96555…cd6230 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=303b17…16ecc3 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=c98996…94525b err="gas limit reached"
INFO [02-27|09:16:07] Generated next block block num=1124898 num txes=5
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386927 unloads=74597
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386927 unloads=74597
INFO [02-27|09:16:07] 🔨 Mined block number=1124898 hash=4204d8eb elapsed=223.060613ms
TRACE[02-27|09:16:07] Pooled new future transaction hash=b9469c…f4f2d3 from=0xcEEa014b672b8b4711213a4af27b188d558B071F to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=b9469c…f4f2d3
INFO [02-27|09:16:07] Submitted contract creation fullhash=0xb9469ca4dfb00aa91b8cd630791695237002e1c72a7b30f4e33d5cbb92f4f2d3 to=0x626122BAF9B70990A07ca9f86C27e793AF3F8ECC
TRACE[02-27|09:16:07] Broadcast transaction hash=b9469c…f4f2d3 recipients=5
TRACE[02-27|09:16:07] Pooled new future transaction hash=50f7de…56fcae from=0x6FD4387f6A5687f85d6b6a879678aF9b5e8F5aEf to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=50f7de…56fcae
TRACE[02-27|09:16:07] Pooled new future transaction hash=98ee4e…e26ce9 from=0x14fC2f8771f10537A7F673255809b4adceD9b416 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=98ee4e…e26ce9
TRACE[02-27|09:16:07] Broadcast transaction hash=50f7de…56fcae recipients=3
TRACE[02-27|09:16:07] Pooled new future transaction hash=afde4f…1fddb6 from=0x16b95251E0F9A0974342D45a2d3969f8dCd76165 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=afde4f…1fddb6
TRACE[02-27|09:16:07] Broadcast transaction hash=afde4f…1fddb6 recipients=3
TRACE[02-27|09:16:07] Pooled new future transaction hash=102c98…43565f from=0xE70aB8A54cd520f5B0C7E2533859Bc969249B510 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=102c98…43565f
TRACE[02-27|09:16:07] Discarding already known transaction hash=98ee4e…e26ce9
TRACE[02-27|09:16:07] Discarding already known transaction hash=50f7de…56fcae
TRACE[02-27|09:16:07] Broadcast transaction hash=98ee4e…e26ce9 recipients=3
TRACE[02-27|09:16:07] Discarding already known transaction hash=afde4f…1fddb6
TRACE[02-27|09:16:07] Discarding already known transaction hash=afde4f…1fddb6
TRACE[02-27|09:16:07] Discarding already known transaction hash=50f7de…56fcae
TRACE[02-27|09:16:07] Discarding already known transaction hash=102c98…43565f
TRACE[02-27|09:16:07] Broadcast transaction hash=102c98…43565f recipients=3
TRACE[02-27|09:16:07] Discarding already known transaction hash=102c98…43565f
TRACE[02-27|09:16:07] Discarding already known transaction hash=50f7de…56fcae
TRACE[02-27|09:16:07] Discarding already known transaction hash=102c98…43565f
TRACE[02-27|09:16:07] Discarding already known transaction hash=98ee4e…e26ce9
TRACE[02-27|09:16:07] Discarding already known transaction hash=50f7de…56fcae
TRACE[02-27|09:16:07] Discarding already known transaction hash=98ee4e…e26ce9
TRACE[02-27|09:16:07] Discarding already known transaction hash=98ee4e…e26ce9
TRACE[02-27|09:16:07] Discarding already known transaction hash=afde4f…1fddb6
TRACE[02-27|09:16:07] Discarding already known transaction hash=102c98…43565f
TRACE[02-27|09:16:07] Discarding already known transaction hash=afde4f…1fddb6
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386946 unloads=74597
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386946 unloads=74602
DEBUG[02-27|09:16:07] Inserted new block number=1124898 hash=63259f…86307a uncles=0 txs=5 gas=762585 elapsed=293.882ms
INFO [02-27|09:16:07] Imported new chain segment blocks=1 txs=5 mgas=0.763 elapsed=294.015ms mgasps=2.594 number=1124898 hash=63259f…86307a
INFO [02-27|09:16:07] persisted the latest applied index index=1125873
DEBUG[02-27|09:16:07] Reinjecting stale transactions count=0
TRACE[02-27|09:16:07] Removed old pending transaction hash=69e4c3…b64d93
TRACE[02-27|09:16:07] Removed old pending transaction hash=6f3d8e…20f1d6
TRACE[02-27|09:16:07] Removed old pending transaction hash=303b17…16ecc3
TRACE[02-27|09:16:07] Removed old pending transaction hash=4ee969…93721b
TRACE[02-27|09:16:07] Removed old pending transaction hash=b96555…cd6230
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386962 unloads=74602
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386962 unloads=74605
DEBUG[02-27|09:16:07] Inserted new block number=1124899 hash=26213a…79240d uncles=0 txs=5 gas=762585 elapsed=71.807ms
INFO [02-27|09:16:07] Imported new chain segment blocks=1 txs=5 mgas=0.763 elapsed=71.900ms mgasps=10.606 number=1124899 hash=26213a…79240d
INFO [02-27|09:16:07] persisted the latest applied index index=1125874
DEBUG[02-27|09:16:07] Reinjecting stale transactions count=0
TRACE[02-27|09:16:07] Removed old pending transaction hash=18d2e7…dfb28c
TRACE[02-27|09:16:07] Removed old pending transaction hash=0df69d…6ca2e0
TRACE[02-27|09:16:07] Removed old pending transaction hash=c98996…94525b
TRACE[02-27|09:16:07] Removed old pending transaction hash=5cd001…a651c6
TRACE[02-27|09:16:07] Removed old pending transaction hash=7f43e5…44188a
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386981 unloads=74605
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386981 unloads=74611
DEBUG[02-27|09:16:07] Inserted new block number=1124900 hash=c986ba…50a257 uncles=0 txs=5 gas=762585 elapsed=34.299ms
INFO [02-27|09:16:07] Imported new chain segment blocks=1 txs=5 mgas=0.763 elapsed=34.402ms mgasps=22.166 number=1124900 hash=c986ba…50a257
DEBUG[02-27|09:16:07] Reinjecting stale transactions count=0
TRACE[02-27|09:16:07] Removed old pending transaction hash=6ecae5…7e980d
TRACE[02-27|09:16:07] Removed old pending transaction hash=460913…095236
TRACE[02-27|09:16:07] Removed old pending transaction hash=4c6077…9cf08d
TRACE[02-27|09:16:07] Removed old pending transaction hash=8522e4…e9d961
TRACE[02-27|09:16:07] Removed old pending transaction hash=5ebccc…65a954
INFO [02-27|09:16:07] TX failed, will be removed hash=7bf5fd…07ea27 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=303b17…16ecc3 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=c98996…94525b err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=23a2c9…6ec205 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=69e4c3…b64d93 err="gas limit reached"
INFO [02-27|09:16:07] Generated next block block num=1124899 num txes=5
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386982 unloads=74614
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386982 unloads=74614
INFO [02-27|09:16:07] 🔨 Mined block number=1124899 hash=c14578da elapsed=259.204588ms
INFO [02-27|09:16:07] TX failed, will be removed hash=7f2780…66b164 err="nonce too high"
TRACE[02-27|09:16:07] Pooled new future transaction hash=01b16a…227db1 from=0xcEEa014b672b8b4711213a4af27b188d558B071F to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=01b16a…227db1
INFO [02-27|09:16:07] Submitted contract creation fullhash=0x01b16a10267f3c004f5a34eb5373d41cd0d58b830b629a4a0413311f3e227db1 to=0x1EA3a6d18E92ba4554098Daa4F19Fc34D1621cbD
TRACE[02-27|09:16:07] Broadcast transaction hash=01b16a…227db1 recipients=5
TRACE[02-27|09:16:07] Pooled new future transaction hash=21db73…036a75 from=0x16b95251E0F9A0974342D45a2d3969f8dCd76165 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=21db73…036a75
TRACE[02-27|09:16:07] Pooled new future transaction hash=f61a5a…792a5b from=0x6FD4387f6A5687f85d6b6a879678aF9b5e8F5aEf to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=f61a5a…792a5b
TRACE[02-27|09:16:07] Broadcast transaction hash=21db73…036a75 recipients=4
TRACE[02-27|09:16:07] Pooled new future transaction hash=3eb6f7…3d3748 from=0x14fC2f8771f10537A7F673255809b4adceD9b416 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=3eb6f7…3d3748
TRACE[02-27|09:16:07] Discarding already known transaction hash=f61a5a…792a5b
TRACE[02-27|09:16:07] Broadcast transaction hash=f61a5a…792a5b recipients=3
TRACE[02-27|09:16:07] Discarding already known transaction hash=3eb6f7…3d3748
TRACE[02-27|09:16:07] Discarding already known transaction hash=21db73…036a75
TRACE[02-27|09:16:07] Discarding already known transaction hash=3eb6f7…3d3748
TRACE[02-27|09:16:07] Broadcast transaction hash=3eb6f7…3d3748 recipients=3
TRACE[02-27|09:16:07] Discarding already known transaction hash=f61a5a…792a5b
TRACE[02-27|09:16:07] Discarding already known transaction hash=21db73…036a75
TRACE[02-27|09:16:07] Discarding already known transaction hash=f61a5a…792a5b
TRACE[02-27|09:16:07] Discarding already known transaction hash=21db73…036a75
TRACE[02-27|09:16:07] Discarding already known transaction hash=f61a5a…792a5b
TRACE[02-27|09:16:07] Pooled new future transaction hash=065476…c57a5f from=0xE70aB8A54cd520f5B0C7E2533859Bc969249B510 to=nil
TRACE[02-27|09:16:07] Promoting queued transaction hash=065476…c57a5f
TRACE[02-27|09:16:07] Broadcast transaction hash=065476…c57a5f recipients=4
TRACE[02-27|09:16:07] Discarding already known transaction hash=3eb6f7…3d3748
TRACE[02-27|09:16:07] Discarding already known transaction hash=3eb6f7…3d3748
TRACE[02-27|09:16:07] Discarding already known transaction hash=065476…c57a5f
TRACE[02-27|09:16:07] Discarding already known transaction hash=065476…c57a5f
TRACE[02-27|09:16:07] Discarding already known transaction hash=065476…c57a5f
TRACE[02-27|09:16:07] Discarding already known transaction hash=065476…c57a5f
INFO [02-27|09:16:07] TX failed, will be removed hash=b09e3e…acacaf err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=4be339…5807a0 err="nonce too high"
INFO [02-27|09:16:07] TX failed, will be removed hash=7bf5fd…07ea27 err="gas limit reached"
INFO [02-27|09:16:07] TX failed, will be removed hash=d22f2f…9ec4cf err="nonce too high"
INFO [02-27|09:16:07] Generated next block block num=1124900 num txes=5
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386996 unloads=74616
DEBUG[02-27|09:16:07] Trie cache stats after commit misses=386996 unloads=74616
INFO [02-27|09:16:07] 🔨 Mined block number=1124900 hash=bd75ea56 el
apsed=290.420475ms
INFO [02-27|09:16:07] TX failed, will be removed hash=4be339…5807a0 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=d41856…84322e err="gas limit reached"
INFO [02-27|09:16:08] TX failed, will be removed hash=d22f2f…9ec4cf err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=7f2780…66b164 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=b09e3e…acacaf err="gas limit reached"
INFO [02-27|09:16:08] Generated next block block num=1124901 num txes=5
DEBUG[02-27|09:16:08] Trie cache stats after commit misses=387012 unloads=74619
DEBUG[02-27|09:16:08] Trie cache stats after commit misses=387012 unloads=74619
INFO [02-27|09:16:08] 🔨 Mined block number=1124901 hash=133ae7fb elapsed=280.952853ms
INFO [02-27|09:16:08] Another node minted; Clearing speculative state block=63259f…86307a
INFO [02-27|09:16:08] persisted the latest applied index index=1125875
INFO [02-27|09:16:08] persisted the latest applied index index=1125875
INFO [02-27|09:16:08] TX failed, will be removed hash=4be339…5807a0 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=3dfdd6…1cf21d err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=d22f2f…9ec4cf err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=7f2780…66b164 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=a5a0a3…813ca1 err="nonce too high"
INFO [02-27|09:16:08] Not minting a new block since there are no pending transactions
INFO [02-27|09:16:08] TX failed, will be removed hash=d22f2f…9ec4cf err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=7f2780…66b164 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=a5a0a3…813ca1 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=4be339…5807a0 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=3dfdd6…1cf21d err="nonce too high"
INFO [02-27|09:16:08] Not minting a new block since there are no pending transactions
INFO [02-27|09:16:08] TX failed, will be removed hash=a5a0a3…813ca1 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=4be339…5807a0 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=3dfdd6…1cf21d err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=d22f2f…9ec4cf err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=7f2780…66b164 err="nonce too high"
INFO [02-27|09:16:08] Not minting a new block since there are no pending transactions
DEBUG[02-27|09:16:08] Trie cache stats after commit misses=387025 unloads=74619
DEBUG[02-27|09:16:08] Trie cache stats after commit misses=387025 unloads=74621
DEBUG[02-27|09:16:08] Inserted new block number=1124901 hash=ab78e9…bce83c uncles=0 txs=5 gas=762585 elapsed=63.624ms
INFO [02-27|09:16:08] Imported new chain segment blocks=1 txs=5 mgas=0.763 elapsed=63.727ms mgasps=11.966 number=1124901 hash=ab78e9…bce83c
INFO [02-27|09:16:08] persisted the latest applied index index=1125876
INFO [02-27|09:16:08] persisted the latest applied index index=1125877
DEBUG[02-27|09:16:08] Reinjecting stale transactions count=0
TRACE[02-27|09:16:08] Removed old pending transaction hash=7f2780…66b164
TRACE[02-27|09:16:08] Removed old pending transaction hash=d22f2f…9ec4cf
TRACE[02-27|09:16:08] Removed old pending transaction hash=3dfdd6…1cf21d
TRACE[02-27|09:16:08] Removed old pending transaction hash=4be339…5807a0
TRACE[02-27|09:16:08] Removed old pending transaction hash=a5a0a3…813ca1
INFO [02-27|09:16:08] TX failed, will be removed hash=63a777…cd9f8c err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=27464d…421925 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=fcc472…40645f err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=0f2c12…b17440 err="nonce too high"
INFO [02-27|09:16:08] TX failed, will be removed hash=171a3f…2b9748 err="nonce too high"
INFO [02-27|09:16:08] Not minting a new block since there are no pending transactions
INFO [02-27|09:16:08] Non-extending block block=2caae3…4039d5 parent=f24593…5fe1c2 head=ab78e9…bce83c
INFO [02-27|09:16:08] persisted the latest applied index index=1125878
INFO [02-27|09:16:08] Non-extending block block=d43300…5f0efa parent=2caae3…4039d5 head=ab78e9…bce83c
INFO [02-27|09:16:08] Handling InvalidRaftOrdering invalid block=2caae3…4039d5 current head=ab78e9…bce83c
INFO [02-27|09:16:08] Someone else mined invalid block; ignoring block=2caae3…4039d5
INFO [02-27|09:16:08] Handling InvalidRaftOrdering invalid block=d43300…5f0efa current head=ab78e9…bce83c
INFO [02-27|09:16:08] persisted the latest applied index index=1125879
INFO [02-27|09:16:08] Someone else mined invalid block; ignoring block=d43300…5f0efa
I'm also facing the same issue,after certain blocks it stops working
Same issue here, especially when dealing with private contracts.
#437 addresses these issues, please rebuild from master.