Closed yacovm closed 8 years ago
Now another error, in latest build ( eaec0807bcdfe31d010395851d7b2c9bef0cf93a ), vp0 crashed.
NumChildren={1}
Childern crypto-hashes:
childNumber={1}, cryptoHash={0e3ef872a6f4b9e3b1264f74152512a6bb7e2fbda74e838e1872a8bc72b8cc282c147650082958e3be55d847d2d62a75a5cb62b30428b693574d583004cbd5d5}
]
panic: runtime error: index out of range
goroutine 37 [running]:
panic(0xd5aec0, 0xc820014050)
/opt/go/src/runtime/panic.go:464 +0x3e6
github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree.(*bucketNode).mergeBucketNode(0xc837c5b3c0, 0xc837880240)
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree/bucket_node.go:73 +0x32b
github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree.(*StateImpl).processBucketTreeDelta(0xc82026d0e0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree/state_impl.go:156 +0x44b
github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree.(*StateImpl).ComputeCryptoHash(0xc82026d0e0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/statemgmt/buckettree/state_impl.go:115 +0x114
github.com/hyperledger/fabric/core/ledger/statemgmt/state.(*State).GetHash(0xc82026d1d0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/statemgmt/state/state.go:237 +0x11d
github.com/hyperledger/fabric/core/ledger.(*Ledger).GetTempStateHash(0xc820291d40, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledger.go:212 +0x42
github.com/hyperledger/fabric/core/peer.(*PeerImpl).GetCurrentStateHash(0xc82026d9f0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:660 +0xc7
github.com/hyperledger/fabric/core/peer/statetransfer.(*StateTransferState).attemptStateTransfer(0xc820202380, 0xc83282de48, 0xc83282de50, 0xc83282de58, 0xc83282de47, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/peer/statetransfer/statetransfer.go:883 +0xcaa
github.com/hyperledger/fabric/core/peer/statetransfer.(*StateTransferState).stateThread(0xc820202380)
/opt/gopath/src/github.com/hyperledger/fabric/core/peer/statetransfer/statetransfer.go:937 +0x2c1
created by github.com/hyperledger/fabric/core/peer/statetransfer.NewStateTransferState
/opt/gopath/src/github.com/hyperledger/fabric/core/peer/statetransfer/statetransfer.go:381 +0x52
In bucket_node.go:
func (bucketNode *bucketNode) mergeBucketNode(anotherBucketNode *bucketNode) {
if !bucketNode.bucketKey.equals(anotherBucketNode.bucketKey) {
panic(fmt.Errorf("Nodes with different keys can not be merged. BaseKey=[%#v], MergeKey=[%#v]", bucketNode.bucketKey, anotherBucketNode.bucketKey))
}
for i, childCryptoHash := range anotherBucketNode.childrenCryptoHash {
if !bucketNode.childrenUpdated[i] {
bucketNode.childrenCryptoHash[i] = childCryptoHash
}
}
}
I guess the other bucket's children crypto hash is too big for the childrenUpdated.
@yacovm did you change the bucket tree configurations in core.yaml after inserting a few transactions?
no
I'll run some more tests, if I still won't be able to reproduce it after 1400 runs I'll close this because it may be related to a container image being created while an already existing database of a prior commit was present in the FS. Does anyone know if when I make images (via the Makefile) - it copies the /var/hyperledger/production/db to the docker image?
I think that the reason of the first panic trace (panic: runtime error: invalid memory address or nil pointer dereference
) above is because of concurrent modifications to state - one by the state transfer thread and another by the transaction execution thread. The logs above the panic trace suggest that state transfer is in progress and the panic stack trace contains the call consensus/helper.(*Helper).CommitTxBatch
.
@jyellick is it possible in the code that state transfer and transaction execution happen concurrently?
For the second panic trace (panic: runtime error: index out of range
) also, I looked at the code again and again, modifying state in parallel could be one of the potential causes. @yacovm do you have full logs or dump of all the active threads so we can verify this.
@manish-sethi In code at commit a94f5a7, it was possible for executions and state transfer to modify the state concurrently, this was addressed in 67396654dfc881219db395e02c1a57ff0b8f3e24, this would additionally have been included in eaec080.
I will note, that state transfer may fill in gaps of blocks in the blockchain concurrently, but state modifications should now be serialized.
Thanks @jyellick. @yacovm so first panic is fixed. For the second, I would need debug logs + dump of other active goroutines to be able to infer.
Can't reproduce. I'm closing it and will re-open if it'll pop up again.
PBFT classic, 4 nodes, no security
commit a94f5a7f559a4b7459e6ba37419e44bf335db81b
Scenario: invoked 5000 transactions of:
All were OK, but the 4 peers chain size were different and they were doing state transfer. vp2 crashed during that.